Class JavaClient

  • All Implemented Interfaces:
    Client

    public class JavaClient
    extends Object
    implements Client
    • Constructor Detail

      • JavaClient

        public JavaClient​(Config config)
    • Method Detail

      • getClient

        public Object getClient()
        Specified by:
        getClient in interface Client
        Returns:
        the underlying client if this instance is wrapping another library.
      • request

        public <T> HttpResponse<T> request​(HttpRequest request,
                                           Function<RawResponse,​HttpResponse<T>> transformer)
        Description copied from interface: Client
        Make a request
        Specified by:
        request in interface Client
        Type Parameters:
        T - The type of the body
        Parameters:
        request - the prepared request object
        transformer - the function to transform the response
        Returns:
        a HttpResponse with a transformed body
      • request

        public <T> CompletableFuture<HttpResponse<T>> request​(HttpRequest request,
                                                              Function<RawResponse,​HttpResponse<T>> transformer,
                                                              CompletableFuture<HttpResponse<T>> callback,
                                                              Class<?> resultType)
        Description copied from interface: Client
        Make a Async request
        Specified by:
        request in interface Client
        Type Parameters:
        T - The type of the body
        Parameters:
        request - the prepared request object
        transformer - the function to transform the response
        callback - the CompletableFuture that will handle the eventual response
        resultType - the final body result type. This is a hint to downstream systems to make up for type erasure.
        Returns:
        a CompletableFuture of a response