kactoos-jvm / nnl.rocks.kactoos.func / CallableOf
class CallableOf<X : Any, T : Any> : Callable<T>
Func as Callable.
You may want to use this decorator where Callable is required, but you just have a function:
Callable<String> callable = new CallableOf<>(i -> "Hello, world!");
There is no thread-safety guarantee.
func - Encapsulated func
input - Input
X - Type of input
T - Type of output
Since 0.12
| Name | Summary |
|---|---|
| <init> | CallableOf(runnable: Runnable, input: X, result: T)CallableOf(proc: Proc<X>, input: X, result: T)CallableOf(func: Func<X, T>, input: X)Func as Callable. |
| Name | Summary |
|---|---|
| call | fun call(): T |