| 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.
|
boolean isPresent()
true if the value is present, false otherwise.T value(T defaultValue)
defaultValue - The value to return if the optional value is not present.T value() throws java.util.NoSuchElementException
java.util.NoSuchElementException - if the optional value is not present.