Modifier and Type | Interface and Description |
---|---|
static class |
Box.Nullable.Default<T>
A simple implementation of Box.Nullable.
|
Modifier and Type | Method and Description |
---|---|
default void |
accept(T value)
Delegates to set().
|
static <T> Box.Nullable<T> |
from(Supplier<T> getter,
Consumer<T> setter)
Creates a Nullable from a Supplier and a Consumer.
|
static <T,V> Box.Nullable<T> |
from(V target,
Function<V,T> getter,
BiConsumer<V,T> setter)
Creates a Nullable from an argument and two functions which operate on that argument.
|
default <R> Box.Nullable<R> |
map(Function<? super T,? extends R> getMapper,
Function<? super R,? extends T> setMapper)
Maps one
Box.Nullable to another Box.Nullable . |
default T |
modify(Function<? super T,? extends T> mutator)
Shortcut for doing a set() on the result of a get().
|
static <T> Box.Nullable<T> |
of(T init)
Creates a Nullable of the given object.
|
static <T> Box.Nullable<T> |
ofNull()
Creates an Nullable holding null.
|
void |
set(T value)
Sets the value which will later be returned by get().
|
void set(T value)
default void accept(T value)
default T modify(Function<? super T,? extends T> mutator)
default <R> Box.Nullable<R> map(Function<? super T,? extends R> getMapper, Function<? super R,? extends T> setMapper)
Box.Nullable
to another Box.Nullable
.static <T> Box.Nullable<T> of(T init)
static <T> Box.Nullable<T> ofNull()
static <T> Box.Nullable<T> from(Supplier<T> getter, Consumer<T> setter)
static <T,V> Box.Nullable<T> from(V target, Function<V,T> getter, BiConsumer<V,T> setter)