Package org.jppf.utils
Class InvocationResult<R>
java.lang.Object
org.jppf.utils.InvocationResult<R>
- Type Parameters:
R- the non-exception type of the referenced object.
- All Implemented Interfaces:
Serializable
Instances of this class hold a reference to an object than can be either of the specified parametrized type or an exception.
They can be seen as a way to carry the result of a method invocation, even if this invocation raises an exception.
- Author:
- Laurent Cohen
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionInitialize with the specified reference object.InvocationResult(R ref) Initialize with the specified reference object. -
Method Summary
-
Constructor Details
-
InvocationResult
Initialize with the specified reference object.- Parameters:
ref- the referenced object with the expected type.
-
InvocationResult
Initialize with the specified reference object.- Parameters:
ref- the referenced object as an exception type.
-
-
Method Details
-
isException
public boolean isException()Determine whether the referenced object is an exception.- Returns:
trueif the referenced object is an exception,falseotherwise.
-
exception
Get the referenced object as an exception.- Returns:
- the referenced object as an
Exception, ornullif it is not an exception.
-
result
Get the invocation result.- Returns:
- the result with the desired parametrized type, or
nullif the result is an exception.
-
toString
-
hashCode
public int hashCode() -
equals
-