Interface Result<T>

Type Parameters:
T - Actual result type.
All Known Implementing Classes:
ErrorResult, SuccessResult

public interface Result<T>
A wrapper for the result object from the endpoint call.
  • Method Summary

    Modifier and Type
    Method
    Description
    Endpoint call duration.
    Returns the result object if the endpoint call succeeded, or throws an exception if otherwise.
    boolean
    If the call succeeds, returns true.
  • Method Details

    • getOrThrow

      T getOrThrow() throws Exception
      Returns the result object if the endpoint call succeeded, or throws an exception if otherwise.
      Returns:
      The result object from the endpoint.
      Throws:
      Exception - If the call failed.
    • duration

      Duration duration()
      Endpoint call duration.
      Returns:
      Duration instance.
    • isSucceeded

      boolean isSucceeded()
      If the call succeeds, returns true.
      Returns:
      f the call succeeds, returns true.