| Constructor and Description |
|---|
Conditional(Predicate<? super T> predicate,
Single<T> targetSingle) |
Conditional(Predicate<T> predicate,
T targetValue) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isPresent()
Returns whether the optional value is present.
|
T |
value()
Returns the optional value.
|
T |
value(T defaultValue)
Returns the optional value or the given default value if the optional value is not present.
|
public boolean isPresent()
Optionalpublic T value() throws java.util.NoSuchElementException
Optionalpublic T value(T defaultValue)
OptionaldefaultValue - The value to return if the optional value is not present.