Class ApiHttpProvider

java.lang.Object
com.reign.api.lib.providers.ApiHttpProvider
All Implemented Interfaces:
IApiProvider

public class ApiHttpProvider extends Object implements IApiProvider
  • Field Details

    • log

      protected static final org.slf4j.Logger log
  • Constructor Details

    • ApiHttpProvider

      public ApiHttpProvider()
  • Method Details

    • commit

      public <T extends ApiModel, Y extends ApiResponse<?>> boolean commit(String endpoint, T apiModel, Class<Y> responseClass)
      Specified by:
      commit in interface IApiProvider
    • fetch

      public <Y extends ApiResponse<?>> Y fetch(String endpoint, Class<Y> responseClass)
      Specified by:
      fetch in interface IApiProvider
    • post

      public <T, Y> T post(String endpoint, Class<T> response, Y body)
      Base method for all POST requests
      Type Parameters:
      T - T JSON-Serializable class which the response will be serialized into.
      Y - Y JSON-Serializable object which the request body will be transformed from.
      Parameters:
      endpoint - Request URI.
      response - Class in which the response will be serialized into.
      body - JSON-Serializable object containing the body data.
      Returns:
      Generic T; Serialized JSON data into an object of type T response.