Interface Endpoint<RequestT,​ResponseT,​ErrorT>

Type Parameters:
RequestT - the endpoint's request
ResponseT - the endpoint's response. Use Void when there's no response body.
ErrorT - the endpoint's error type. Use Void when error responses have no body.
All Known Implementing Classes:
BooleanEndpoint, SimpleEndpoint

public interface Endpoint<RequestT,​ResponseT,​ErrorT>
And endpoint links request and responses to protocol encoding. It also defines the error response when the server cannot perform the request.
  • Method Details

    • method

      java.lang.String method​(RequestT request)
      The endpoint's http method
    • requestUrl

      java.lang.String requestUrl​(RequestT request)
      Build the URL path for a request
    • queryParameters

      default java.util.Map<java.lang.String,​java.lang.String> queryParameters​(RequestT request)
      Build the query parameters for a request
    • headers

      default java.util.Map<java.lang.String,​java.lang.String> headers​(RequestT request)
      Build the headers for a request
    • hasRequestBody

      boolean hasRequestBody()
    • responseParser

      @Nullable JsonpDeserializer<ResponseT> responseParser()
      The entity parser for the response body. Can be null to indicate that there's no response body.
    • isError

      boolean isError​(int statusCode)
    • errorParser

      @Nullable JsonpDeserializer<ErrorT> errorParser​(int statusCode)
      The entity parser for the error response body. Can be null to indicate that there's no error body.