Class PromaResponse<T>

java.lang.Object
de.xima.fc.proma.provider.PromaResponse<T>
Type Parameters:
T - Type of the result.
All Implemented Interfaces:
IPromaResponse<T>

public final class PromaResponse<T> extends Object implements IPromaResponse<T>
POJO for IPromaResponse.
Author:
XIMA MEDIA GmbH
  • Method Details

    • value

      public T value()
      Specified by:
      value in interface IPromaResponse<T>
      Returns:
      Transformed result of the response, usually from the HTTP response body.
    • statusCode

      public int statusCode()
      Specified by:
      statusCode in interface IPromaResponse<T>
      Returns:
      Status code of the HTTP response.
    • empty

      public static <T> IPromaResponse<T> empty(int statusCode)
      Type Parameters:
      T - Type of the result.
      Parameters:
      statusCode - Status code of the HTTP response.
      Returns:
      A new POJO with the given status code and a null result.
    • of

      public static <T> IPromaResponse<T> of(int statusCode, T result)
      Type Parameters:
      T - Type of the result.
      Parameters:
      statusCode - Status code of the HTTP response.
      result - Transformed result of the response, usually from the HTTP response body.
      Returns:
      A new POJO with the given data.