Optional
type introduced in Java 8 is a new thing for many developers.
Is a getter method returning Optional<Foo>
type in place of the classic Foo
a good practice? Assume that the value can be null
.
Optional
type introduced in Java 8 is a new thing for many developers.
Is a getter method returning Optional<Foo>
type in place of the classic Foo
a good practice? Assume that the value can be null
.