V - The type of the supplied value@FunctionalInterface public static interface ViewableAsOptional.Single<V> extends Supplier<V>, ViewableAsOptional<V>
Supplier which is also ViewableAsOptional.ViewableAsOptional.Single<V>, ViewableAsOptional.TooManyElements| Modifier and Type | Method and Description |
|---|---|
default Optional<V> |
toOptional()
Convert this object to an
Optional by wrapping the
value returned from Supplier.get(). |
default Optional<V> toOptional() throws ViewableAsOptional.TooManyElements
Optional by wrapping the
value returned from Supplier.get().toOptional in interface ViewableAsOptional<V>Supplier.get(), wrapped in an Optional.
If get() returns null, Optional.empty() is returned.ViewableAsOptional.TooManyElements - if this object contains more than one element, and thus
is not applicable for lossless conversion to an Optional.Copyright © 2018 Digipost. All rights reserved.