Class OperationResult<SuccessTypeT,​FailureTypeT>


  • public final class OperationResult<SuccessTypeT,​FailureTypeT>
    extends Object
    • 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.