|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.op4j.functions.Function<T,R> org.op4j.functions.AbstractNullAsNullFunction<T,R>
public abstract class AbstractNullAsNullFunction<T,R>
Base abstract class for functions returning null if the target object is null.
This class can be extended by the user when creating his/her own functions, if desired.
Constructor Summary | |
---|---|
protected |
AbstractNullAsNullFunction()
|
Method Summary | |
---|---|
R |
execute(T input,
ExecCtx ctx)
Executes the function on the current target object, which is passed as the input parameter. |
protected abstract R |
nullAsNullExecute(T input,
ExecCtx ctx)
Executes the function knowing that the input parameter (the target object) is not null. |
Methods inherited from class org.op4j.functions.Function |
---|
execute |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractNullAsNullFunction()
Method Detail |
---|
public final R execute(T input, ExecCtx ctx) throws Exception
IFunction
Executes the function on the current target object, which is passed
as the input parameter. The ExecCtx
parameter
provides some metadata related to the execution, like the index in
an iteration.
The execution of a function can throw any exception.
If you intend to call the execute method directly on any of
your functions (outside an op4j expression), you might prefer using
Function.execute(Object)
instead.
input
- the target object on which the function is to be executedctx
- the context (metadata) for the function execution
Exception
protected abstract R nullAsNullExecute(T input, ExecCtx ctx) throws Exception
Executes the function knowing that the input parameter (the target object) is not null. If the target object is null, the function will return null instead of calling this method.
input
- the target objectctx
- the execution context
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |