| Modifier and Type | Method and Description |
|---|---|
ImmutableOptionalValue<E> |
asImmutable()
Gets the
ImmutableValue version of this Value such that
all data is duplicated across to the new ImmutableValue. |
OptionalValue<E> |
copy()
Makes an independent copy of this
Value with the same initial
data. |
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.
|
OptionalValue<E> set(Optional<E> value)
Valuevalue.set in interface Value<Optional<E>>value - The value to setValueContainerOptionalValue<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 valueOptionalValue<E> copy()
ValueValue with the same initial
data. Both this value and the new value will refer to the same object
initially.ImmutableOptionalValue<E> asImmutable()
ValueImmutableValue version of this Value such that
all data is duplicated across to the new ImmutableValue. Note
that once created, the ImmutableValue is not going to change.asImmutable in interface Value<Optional<E>>ImmutableValue instance