Modifier and Type | Method and Description |
---|---|
Value<E> |
or(E defaultValue)
|
OptionalValue<E> |
set(Optional<E> value)
Sets the underlying value to the provided
value . |
OptionalValue<E> |
setTo(E value)
Sets the underlying value, may be null.
|
asImmutable, transform
OptionalValue<E> set(Optional<E> value)
Value
value
.set
in interface Value<Optional<E>>
value
- The value to setValueContainer
OptionalValue<E> setTo(@Nullable E value)
value
- The value to setValue<E> or(E defaultValue)
null
, the default value is returned as a Value
, if
the underlying value is present, the underlying value is returned
as a Value
.defaultValue
- The value to substitute, if the underlying value is
nullValue
with a non-null value