Modifier and Type | Method and Description |
---|---|
static <T> StatusWithResult<T> |
create(T resultOrNull)
Creates a new result with status
StatusFlag.OK and resultOrNull. |
static <T> StatusWithResult<T> |
createError() |
static <T> StatusWithResult<T> |
createError(boolean retriable)
Create an error.
|
static <T> StatusWithResult<T> |
createError(boolean retriable,
java.lang.String message) |
static <T> StatusWithResult<T> |
createError(java.lang.String message) |
static <T> StatusWithResult<T> |
createRetriableError() |
static <T> StatusWithResult<T> |
createRetriableError(java.lang.String message) |
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
java.lang.String |
toString() |
T |
tryGetResult()
Returns the result of the operation (may be
null ). |
createError, createRetriableError, getFlag, isError, isNonRetriableError, isOK, isRetriableError, tryGetErrorMessage
public static <T> StatusWithResult<T> create(T resultOrNull)
StatusFlag.OK
and resultOrNull.public static <T> StatusWithResult<T> createError(boolean retriable)
retriable
- If true
, the error will be marked 'retriable'.public static <T> StatusWithResult<T> createError(boolean retriable, java.lang.String message)
public static <T> StatusWithResult<T> createError()
public static <T> StatusWithResult<T> createError(java.lang.String message)
public static <T> StatusWithResult<T> createRetriableError()
public static <T> StatusWithResult<T> createRetriableError(java.lang.String message)
public final T tryGetResult()
null
).