Class StatusWithResult<T>
- java.lang.Object
-
- ch.systemsx.cisd.common.exceptions.Status
-
- ch.systemsx.cisd.common.exceptions.StatusWithResult<T>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
StatusWithResult(StatusFlag flag, java.lang.String messageOrNull, T resultOrNull)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> StatusWithResult<T>
create(T resultOrNull)
Creates a new result with statusStatusFlag.OK
and resultOrNull.static <T> StatusWithResult<T>
createErrorWithResult()
static <T> StatusWithResult<T>
createErrorWithResult(boolean retriable)
Create an error.static <T> StatusWithResult<T>
createErrorWithResult(java.lang.String message)
static <T> StatusWithResult<T>
createErrorx(boolean retriable, java.lang.String message)
static <T> StatusWithResult<T>
createRetriableErrorWithResult()
static <T> StatusWithResult<T>
createRetriableErrorWithResult(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 benull
).-
Methods inherited from class ch.systemsx.cisd.common.exceptions.Status
createError, createError, createError, createError, createError, createRetriableError, createRetriableError, createRetriableError, getErrorFlag, getFlag, isError, isNonRetriableError, isOK, isRetriableError, tryGetErrorMessage
-
-
-
-
Constructor Detail
-
StatusWithResult
protected StatusWithResult(StatusFlag flag, java.lang.String messageOrNull, T resultOrNull)
-
-
Method Detail
-
create
public static <T> StatusWithResult<T> create(T resultOrNull)
Creates a new result with statusStatusFlag.OK
and resultOrNull.
-
createErrorWithResult
public static <T> StatusWithResult<T> createErrorWithResult(boolean retriable)
Create an error.- Parameters:
retriable
- Iftrue
, the error will be marked 'retriable'.
-
createErrorx
public static <T> StatusWithResult<T> createErrorx(boolean retriable, java.lang.String message)
-
createErrorWithResult
public static <T> StatusWithResult<T> createErrorWithResult()
-
createErrorWithResult
public static <T> StatusWithResult<T> createErrorWithResult(java.lang.String message)
-
createRetriableErrorWithResult
public static <T> StatusWithResult<T> createRetriableErrorWithResult()
-
createRetriableErrorWithResult
public static <T> StatusWithResult<T> createRetriableErrorWithResult(java.lang.String message)
-
tryGetResult
public final T tryGetResult()
Returns the result of the operation (may benull
).
-
-