Interface OperationResult

All Known Implementing Classes:
FailedOperationResult, SuccessOperationResult, UnknownOperationResult

public interface OperationResult
Operation result object.
  • Method Details

    • fail

      static OperationResult fail()
    • success

      static OperationResult success()
    • getStatus

      Returns:
      status of the operation
    • compose

      Creates new operation result that represents composition of two operation results. If this result is resolved as successful, then the second result will be obtained from the passed supplier.
      Parameters:
      nextStep - the next operation result supplier
      Returns:
      new composite operation result
    • then

      OperationResult then(Runnable runnable)
      Adds success callback to the operation result.
      Parameters:
      runnable - callback
      Returns:
      this
    • otherwise

      OperationResult otherwise(Runnable runnable)
      Adds fail callback to the operation result.
      Parameters:
      runnable - callback
      Returns:
      this