| Modifier and Type | Method and Description |
|---|---|
<R> Box<R> |
Box.map(java.util.function.Function<T,R> valueFunction)
Map current underlying value of T into value of Box of R.
|
<R> Box<R> |
Box.map(java.util.function.Function<T,R> valueFunction,
java.util.function.Supplier<R> fallbackSupplier)
When valueFunction failed during map(), use output from fallbackSupplier()
|
static <T> Box<T> |
Box.of(T obj)
Static constructor.
|
Box<T> |
Box.or(java.util.function.Supplier<T> fallbackSupplier)
If not exists, function mod's value will be set for the value.
|
<X extends Throwable> |
Box.orThrow(java.util.function.Supplier<? extends X> exceptionSupplier)
If the Box is empty, throw an exception.
|
Box<T> |
Box.then(java.util.function.Consumer<T> valueConsumer)
Run consumer mod.
|
Box<T> |
Box.update(java.util.function.UnaryOperator<T> valueOperator)
Update will replace underlying T value.
|
Copyright © 2023. All rights reserved.