Other |
---|
tbdUnresolved |
Relates :
|
|
Relates :
|
Add a method something like this to Optional: public <R> R transform(Function<Optional<T>, ? extends R> f) { return f.apply(this); } This allows the caller to provide an arbitrary operation to be performed on "this" Optional, regardless of whether it's empty or present. The name "transform" follows precedent set by String::transform (JDK-8203442).
|