public interface Unit<T>
| Modifier and Type | Method and Description |
|---|---|
default void |
accept(Consumer<? super T> consumer)
Accept unit with consumer.
|
<R> R |
apply(Function<? super T,? extends R> func)
Apply unit using function.
|
static <T> Optional<Unit<? extends T>> |
maybe(Optional<? extends T> optional) |
static <T> Unit<T> |
of(T val)
New unit.
|
default <U> Pair<T,U> |
push(U val)
Push second item to make a pair.
|
<R> R apply(Function<? super T,? extends R> func)
R - Result typefunc - Function to applydefault void accept(Consumer<? super T> consumer)
consumer - Acceptordefault <U> Pair<T,U> push(U val)
U - Second item typeval - Second item valuestatic <T> Unit<T> of(T val)
T - Item typeval - Item valueCopyright © 2021. All rights reserved.