Class ServiceClient


  • public abstract class ServiceClient
    extends Object
    ServiceClient is the abstraction for accessing REST operations and their payload data types.
    • Constructor Detail

      • ServiceClient

        protected ServiceClient​(String baseUrl)
        Initializes a new instance of the ServiceClient class.
        Parameters:
        baseUrl - the service endpoint
      • ServiceClient

        protected ServiceClient​(String baseUrl,
                                okhttp3.OkHttpClient.Builder clientBuilder,
                                retrofit2.Retrofit.Builder restBuilder)
        Initializes a new instance of the ServiceClient class.
        Parameters:
        baseUrl - the service base uri
        clientBuilder - the http client builder
        restBuilder - the retrofit rest client builder
      • ServiceClient

        protected ServiceClient​(RestClient restClient)
        Initializes a new instance of the ServiceClient class.
        Parameters:
        restClient - the REST client
    • Method Detail

      • retrofit

        public retrofit2.Retrofit retrofit()
        Returns:
        the Retrofit instance.
      • httpClient

        public okhttp3.OkHttpClient httpClient()
        Returns:
        the HTTP client.
      • serializerAdapter

        public SerializerAdapter<?> serializerAdapter()
        Returns:
        the adapter to a Jackson ObjectMapper.