de.danet.an.workflow.api
Class MethodInvocationBatch.Result

java.lang.Object
  extended byde.danet.an.workflow.api.MethodInvocationBatch.Result
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
MethodInvocationBatch

public class MethodInvocationBatch.Result
extends java.lang.Object
implements java.io.Serializable

The result of an execution of this kind of batch.

See Also:
Serialized Form

Constructor Summary
MethodInvocationBatch.Result(java.lang.Object[] theResults, boolean exceptionsOccured)
          Construct a new Result objects with the given attributes.
 
Method Summary
 java.lang.Exception firstException()
          Return the first exception in the result list.
 boolean hasExceptions()
          Return true if any exceptions have occured during batch execution.
 java.lang.Object result(int i)
          Returns the result with the given index.
 java.util.Date resultAsDate(int i)
          Returns the result with the given index as Date.
 int resultAsInt(int i)
          Returns the result with the given index as int.
 java.lang.String resultAsString(int i)
          Returns the result with the given index as String.
 java.lang.Object[] results()
          The results as an array of objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodInvocationBatch.Result

public MethodInvocationBatch.Result(java.lang.Object[] theResults,
                                    boolean exceptionsOccured)
Construct a new Result objects with the given attributes.

Parameters:
theResults - the results attribute.
exceptionsOccured - the exceptions attribute.
Method Detail

results

public java.lang.Object[] results()
The results as an array of objects. Each entry in the array corresponds to a method call and is either a result (with java primitive types wrapped in corresponding objects) or an exception thrown by the invoked method.

Returns:
the results.

result

public java.lang.Object result(int i)
Returns the result with the given index.

Parameters:
i - the index into the result array.
Returns:
result.

resultAsString

public java.lang.String resultAsString(int i)
Returns the result with the given index as String.

Parameters:
i - the index into the result array.
Returns:
result as String.

resultAsDate

public java.util.Date resultAsDate(int i)
Returns the result with the given index as Date.

Parameters:
i - the index into the result array.
Returns:
result as Date.

resultAsInt

public int resultAsInt(int i)
Returns the result with the given index as int.

Parameters:
i - the index into the result array.
Returns:
result as int.

hasExceptions

public boolean hasExceptions()
Return true if any exceptions have occured during batch execution.

Returns:
true if execeptions have occured.

firstException

public java.lang.Exception firstException()
                                   throws java.lang.IllegalStateException
Return the first exception in the result list.

Returns:
the first exception.
Throws:
java.lang.IllegalStateException - if the result includes no exceptions.