We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html
To deal with missing or null values by abstracting null checks
of()
empty()
ofNullable()
ifPresent()
orElse()
orElseGet()
map()
flatMap()
Notes: Use if-else approach for declarative programming; Avoid get(), isPresent(), isEmpty() (breaks Tell-Don’t-Ask principle)