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
Modifier and TypeMethodDescriptionReturns additional information if availableReturn the causing Exception Object if available.intReturns the numeric error code for the failed operation.Returns a descriptive error message if the operation failed.Returns the result object of the operation.booleanDefines if the operation executed successfully or not.
-
Method Details
-
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
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
Returns additional information if available- Returns:
- hash map of additional information
-
getCausingException
Throwable getCausingException()Return the causing Exception Object if available. Can be null- Returns:
- the throwable
-