Kactoos

kactoos-jvm / nnl.rocks.kactoos.func / CallableOf

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.

Parameters

func - Encapsulated func

input - Input

X - Type of input

T - Type of output

Since 0.12

Constructors

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.

Functions

Name Summary
call fun call(): T