TDD, 클린 코드 with Java 18기: 사다리타기 - FP, OOP(스트림, 람다, Optional)

yshjft·2024년 5월 21일
0

사다리타기 - FP, OOP(스트림, 람다, Optional)

미션하며 정리한 내용

👨‍💻 optional.map

The map call is simply used to transform a value to some other value. Keep in mind that this operation does not modify the original value.
...
The map method however takes the existing value, performs a computation using this value, and returns the result of the computation wrapped in an Optional object
Guide To Java 8 Optional

Optional 객체가 값을 갖고 있으면, map 메서드로 넘겨진 함수를 통해 값의 형태를 변경한다. Optional 객체가 비어있는 경우 연산을 수행하지 않는다.
자바 Optional: 3. Optional 중간 처리 메서드


👨‍💻 optional.filter

If the wrapped value passes testing by the predicate, then the Optional is returned as-is. However, if the predicate returns false, then it will return an empty Optional
Guide To Java 8 Optional



리뷰 내용

🤔 리뷰 링크

사다리타기 - FP, OOP: 1단계 - 스트림, 람다, Optional #2065

profile
꾸준히 나아가자 🐢

0개의 댓글