|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.op4j.functions.Function<T,R>
public abstract class Function<T,R>
Base abstract implementation for the IFunction
interface,
providing a useful execute(Object)
method, easier to use
than IFunction.execute(Object, ExecCtx)
.
Function<T,R> means that the function receives an object of type T (called target) and returns an object of type R.
You should consider extending this class for every function class you write (except for anonymous ones). This will allow you to execute the function without passing a context to the execution method and without having to enclose your call inside a try...catch statement.
Constructor Summary | |
---|---|
protected |
Function()
|
Method Summary | |
---|---|
R |
execute(T input)
Executes the current function on the target object. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.op4j.functions.IFunction |
---|
execute |
Constructor Detail |
---|
protected Function()
Method Detail |
---|
public R execute(T input)
Executes the current function on the target object. The target object is passed as the input parameter.
Should any exceptions raise during execution, they will be
encapsulated in an unchecked ExecutionException
exception.
input
- the target object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |