Interface AsyncResult<T>
-
- Type Parameters:
T
- The expected data type of the result of the operation
public interface AsyncResult<T>
The result object that will be returned by all operations in this SDK. This generic result object will contain:- A flag to easily determine if the operation is successful or not. See
isSuccessful()
- The result object - This will contain the result of the operation, with
the expected data type, should the operation be successful. See
getResult()
- The error message - This will contain a descriptive message detailing the
reasons for the failed operation. This will be null if the operation is
successful. See
getErrorMessage()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.HashMap<java.lang.String,java.lang.Object>
getAdditionalInformation()
Returns additional information if availablejava.lang.Throwable
getCausingException()
Return the causing Exception Object if available.int
getErrorCode()
Returns the numeric error code for the failed operation.java.lang.String
getErrorMessage()
Returns a descriptive error message if the operation failed.T
getResult()
Returns the result object of the operation.boolean
isSuccessful()
Defines if the operation executed successfully or not.
-
-
-
Method Detail
-
isSuccessful
boolean isSuccessful()
Defines if the operation executed successfully or not.- Returns:
- Returns true if the operation executed successfully. Otherwise, it returns false.
-
getResult
T getResult()
Returns the result object of the operation.- Returns:
- The result of the operation.
-
getErrorMessage
java.lang.String getErrorMessage()
Returns a descriptive error message if the operation failed. If the operation is successful, this will return null.- Returns:
- String representation of the error message describing why the operation failed. It returns null if the operation is successful.
-
getErrorCode
int getErrorCode()
Returns the numeric error code for the failed operation. If the operation is successful, this will return zero.- Returns:
- code that indicates the numeric value for the particular error occurred.
-
getAdditionalInformation
java.util.HashMap<java.lang.String,java.lang.Object> getAdditionalInformation()
Returns additional information if available- Returns:
- hash map of additional information
-
getCausingException
java.lang.Throwable getCausingException()
Return the causing Exception Object if available. Can be null- Returns:
- the throwable
-
-