| Modifier and Type | Field and Description |
|---|---|
protected static Object[] |
NO_ARGS |
protected ProcBase |
source |
| Modifier | Constructor and Description |
|---|---|
protected |
ProcBase() |
protected |
ProcBase(Object... args) |
protected |
ProcBase(ProcBase source)
Creates a ProcBase that uses the run-method of
source instead of its own. |
protected |
ProcBase(ProcBase source,
Object... args) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
args(Object... args)
Sets the arguments, for internal use only.
|
P0 |
asProc0() |
<A> P1<A> |
asProc1() |
<A,B> P2<A,B> |
asProc2() |
<A,B,C> P3<A,B,C> |
asProc3() |
<A,B,C,D> P4<A,B,C,D> |
asProc4() |
protected void |
assertArgCount(Object[] args,
int count)
Throws a ProcError exception if {@code args.length !
|
This |
call(Object... args)
Creates a new Proc that invokes the code of this Proc with
args. |
This |
callAgain()
Creates a new Proc that invokes the code of this Proc
and uses the same arguments.
|
protected This |
copy() |
protected This |
copy(Object... args) |
protected abstract This |
createCopy(Object[] args) |
Proc |
curry(Object... args) |
Proc |
curryAt(int i,
Object... args) |
protected int |
describeArgsTo(org.hamcrest.Description description)
Describes the arguments that are used for execution this asProc.
|
protected void |
describeKeyTo(org.hamcrest.Description description) |
protected void |
describeNameTo(org.hamcrest.Description description) |
void |
describeTo(org.hamcrest.Description description) |
protected ProcError |
exception(Class<? extends RuntimeException> reClazz,
String message,
Throwable cause) |
protected Object |
executeProc(Object... args) |
Object[] |
getArgs()
The arguments that were used for the execution of this Proc.
|
Throwable |
getException()
Returns the exception that was thrown during execution,
or
null if the proc completed without error. |
Object |
getResult()
Returns the result of the execution,
or
null if an exception was thrown. |
boolean |
hasResult()
Returns true iff executing this Proc caused no exceptions.
|
protected ProcError |
illegalArgumentException(String message) |
protected void |
name(String name)
Sets the name of this proc.
|
protected UnsupportedOperationException |
notImplemented(String method) |
This |
retry()
Resets the Proc.
|
protected abstract Object |
run(Object[] args)
Execute the proc.
|
protected ProcError |
runtimeException(String message) |
protected ProcError |
runtimeException(String message,
Throwable cause) |
String |
toString() |
This |
with(Object... args)
Alias for
Proc.call(java.lang.Object[]). |
protected ProcBase()
protected ProcBase(Object... args)
protected ProcBase(ProcBase source)
source instead of its own.source - protected final void args(Object... args)
args - public Object[] getArgs()
protected final void name(String name)
name - protected void assertArgCount(Object[] args, int count)
args.length != countargs - count - protected UnsupportedOperationException notImplemented(String method)
protected abstract Object run(Object[] args) throws Throwable
Throwableprotected This copy()
public This retry()
public This callAgain()
public This call(Object... args)
args.public This with(Object... args)
Proc.call(java.lang.Object[]).with in interface ProcProc.call(java.lang.Object[])public boolean hasResult()
Proc.getResult() can be called to retrieve the result of
the execution. Otherwise, Proc.getException() will return the
exception that was thrown.public Object getResult()
null if an exception was thrown.public Throwable getException()
null if the proc completed without error.getException in interface Procpublic void describeTo(org.hamcrest.Description description)
describeTo in interface org.hamcrest.SelfDescribingprotected void describeKeyTo(org.hamcrest.Description description)
protected void describeNameTo(org.hamcrest.Description description)
protected int describeArgsTo(org.hamcrest.Description description)
description - protected ProcError exception(Class<? extends RuntimeException> reClazz, String message, Throwable cause)
Copyright © 2013. All Rights Reserved.