Package no.digipost.util
Interface ViewableAsOptional<V>
- All Known Subinterfaces:
Assignment<V>,AtMostOne<T>,ViewableAsOptional.Single<V>
- All Known Implementing Classes:
ChainableAssignment,OneTimeAssignment
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceASupplierwhich is alsoViewableAsOptional.static classAn object which was attempted to be viewed as aOptionalrepresentation of itself contained more than one element, and is thus not applicable for such conversion. -
Method Summary
-
Method Details
-
toOptional
Get anOptionalrepresentation of this object. If it contains more elements than one, and thus cannot be viewed as anOptionalwithout loosing any information, aViewableAsOptional.TooManyElementsis thrown.- Returns:
- the
Optionalrepresentation of this object. - Throws:
ViewableAsOptional.TooManyElements- if this object contains more than one element, and thus is not applicable for lossless conversion to an Optional.
-