java.util.Optional class helps prevent null pointer exceptions when used as a method return type instead of returning 'raw' objects (those may be null, potentially resulting in NPE).
However, what about other uses? Is it a good idea to use Optional as object field(s) type? Static class fields? I.e.,
class MyClass {
private Optional<String> myValue; // does it look reasonable?
}
Thanks!