open class FuncUtils
Utility methods to execute Block functions.
| FuncUtils()Utility methods to execute  | 
| open static fun <T : Any!> apply(optional: Optional<out T>, fun: Block<T>): Unitopen static fun <T : Any!> apply(optional: Optional<out T>, fun: Block<T>, otherwise: Runnable): UnitRun function when optional is not absent. open static fun <T : Any!> apply(obj: Any, type: Class<T>, fun: Block<T>): UnitRun function when object is of the specific type. open static fun <T : Any!> apply(obj: Any, type: Class<T>, fun: Block<T>, otherwise: Runnable): UnitRun function when object is of the specific type otherwise runnable is run. | |
| open static fun <T : Any!> first(iterable: MutableIterable<T>): Optional<T>!Return first element from iterable when possible. Absent element return when list is empty. | |
| open static fun <T : Any!> forEach(iterable: MutableIterable<T>, fun: Block<T>): UnitIterate iterable and apply function on each item. | |
| open static fun <T : Any!> forEachIndexed(iterable: MutableIterable<T>, fun: BlockWithIndex<T>): UnitIterate iterable and apply function on each item. | |
| open static fun <T : Any!> forWeekEach(iterable: MutableIterable<WeakReference<out T>!>, fun: Block<WeakReference<out T>!>): UnitIterate iterable and apply function on each item. |