public class FuncUtils
extends java.lang.Object
Block functions.| Constructor and Description |
|---|
FuncUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> void |
apply(Optional<? extends T> optional,
Block<T> fun)
Run function when optional is not absent.
|
static <T> void |
apply(Optional<? extends T> optional,
Block<T> fun,
java.lang.Runnable otherwise)
Run function when optional is not absent.
|
static <T> void |
forEach(java.lang.Iterable<? extends T> iterable,
Block<T> fun)
Iterate iterable and apply function on each item.
|
static <T> void |
forWeekEach(java.lang.Iterable<java.lang.ref.WeakReference<? extends T>> iterable,
Block<java.lang.ref.WeakReference<? extends T>> fun)
Iterate iterable and apply function on each item.
|
public static <T> void forWeekEach(java.lang.Iterable<java.lang.ref.WeakReference<? extends T>> iterable,
Block<java.lang.ref.WeakReference<? extends T>> fun)
iterable - Iterablefun - Function which will be appliedpublic static <T> void forEach(java.lang.Iterable<? extends T> iterable,
Block<T> fun)
iterable - Iterablefun - Function which will be appliedpublic static <T> void apply(Optional<? extends T> optional, Block<T> fun)
T - optional - When optional is present, fun is runfun - Function which is run when optional is presentpublic static <T> void apply(Optional<? extends T> optional, Block<T> fun, java.lang.Runnable otherwise)
T - optional - When optional is present, fun is runfun - Function which is run when optional is presentotherwise - Call this function when optional is not present