Package no.digipost.util
Interface ViewableAsOptional.Single<V>
- Type Parameters:
V- The type of the supplied value
- All Superinterfaces:
Supplier<V>,ViewableAsOptional<V>
- All Known Subinterfaces:
Assignment<V>
- All Known Implementing Classes:
ChainableAssignment,OneTimeAssignment
- Enclosing interface:
ViewableAsOptional<V>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public static interface ViewableAsOptional.Single<V>
extends Supplier<V>, ViewableAsOptional<V>
A
Supplier which is also ViewableAsOptional.-
Nested Class Summary
Nested classes/interfaces inherited from interface no.digipost.util.ViewableAsOptional
ViewableAsOptional.Single<V>, ViewableAsOptional.TooManyElements -
Method Summary
Modifier and TypeMethodDescriptionConvert this object to anOptionalby wrapping the value returned fromSupplier.get().
-
Method Details
-
toOptional
Convert this object to anOptionalby wrapping the value returned fromSupplier.get().- Specified by:
toOptionalin interfaceViewableAsOptional<V>- Returns:
- the value returned from
Supplier.get(), wrapped in anOptional. Ifget()returnsnull,Optional.empty()is returned. - Throws:
ViewableAsOptional.TooManyElements- if this object contains more than one element, and thus is not applicable for lossless conversion to an Optional.
-