Class OperationResult<SuccessTypeT,FailureTypeT>
- java.lang.Object
-
- com.mongodb.stitch.core.internal.common.OperationResult<SuccessTypeT,FailureTypeT>
-
public final class OperationResult<SuccessTypeT,FailureTypeT> extends Object
-
-
Method Summary
Modifier and Type Method Description static <T,U>
OperationResult<T,U>failedResultOf(U value)
SuccessTypeT
geResult()
Gets the result of the operation, if successful.FailureTypeT
getFailure()
Gets the failure reason for the operation, if it failed.boolean
isSuccessful()
static <T,U>
OperationResult<T,U>successfulResultOf(T value)
-
-
-
Method Detail
-
successfulResultOf
public static <T,U> OperationResult<T,U> successfulResultOf(T value)
-
failedResultOf
public static <T,U> OperationResult<T,U> failedResultOf(U value)
-
isSuccessful
public boolean isSuccessful()
-
geResult
public SuccessTypeT geResult()
Gets the result of the operation, if successful.- Returns:
- The result of the operation.
-
getFailure
public FailureTypeT getFailure()
Gets the failure reason for the operation, if it failed.- Returns:
- The failure reason of the operation.
-
-