@FunctionalInterface public interface ViewableAsOptional<V>
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ViewableAsOptional.Single<V>
A
Supplier which is also ViewableAsOptional. |
static class |
ViewableAsOptional.TooManyElements
An object which was attempted to be viewed as a
Optional
representation of itself contained more than one element, and is thus
not applicable for such conversion. |
| Modifier and Type | Method and Description |
|---|---|
Optional<V> |
toOptional()
Get an
Optional representation of this object. |
Optional<V> toOptional() throws ViewableAsOptional.TooManyElements
Optional representation of this object. If it contains
more elements than one, and thus cannot be viewed as an Optional without
loosing any information, a ViewableAsOptional.TooManyElements is thrown.Optional representation of this object.ViewableAsOptional.TooManyElements - if this object contains more than one element, and thus
is not applicable for lossless conversion to an Optional.Copyright © 2016 Digipost. All rights reserved.