Class UserDetailsClient.Builder

java.lang.Object
au.org.ala.userdetails.UserDetailsClient.Builder
Enclosing interface:
UserDetailsClient

public static class UserDetailsClient.Builder extends Object
A Builder for generating UserDetailsClient instances.
  • Constructor Details

    • Builder

      public Builder(okhttp3.Call.Factory callFactory, String baseUrl)
      Create a Builder using an okHttpClient and String baseUrl. The baseUrl will be converted to an HttpUrl and a trailing / will be added if required.
      Parameters:
      callFactory - The call factory to use (usually an OkHttpClient)
      baseUrl - The base URL of the User Details service
    • Builder

      public Builder(okhttp3.Call.Factory callFactory, okhttp3.HttpUrl baseUrl)
      Creates a new Builder instance.
      Parameters:
      callFactory - The Call.Factory to use for calling the web services. Most of the time this will be an OkHttpClient but this accepts a Call.Factory to allow the OkHttpClient to be proxied via a Call.Factory in order to allow health checks and metrics gathering, for example.
      baseUrl -
  • Method Details

    • from

      public static UserDetailsClient.Builder from(okhttp3.Call.Factory callFactory, String baseUrl)
    • build

      public UserDetailsClient build()
      Create the UserDetailsClient instance. If a moshi instance is not supplied, one will be created.
      Returns:
      A UserDetailsClient using the supplied okhttpclient, baseUrl and moshi.
    • callFactory

      public okhttp3.Call.Factory callFactory()
      The Call.Factory to use for calling the web services. Most of the time this will be an OkHttpClient but this accepts a Call.Factory to allow the OkHttpClient to be proxied via a Call.Factory in order to allow health checks and metrics gathering, for example.
    • baseUrl

      public okhttp3.HttpUrl baseUrl()
    • moshi

      public com.squareup.moshi.Moshi moshi()
    • moshi

      public UserDetailsClient.Builder moshi(com.squareup.moshi.Moshi moshi)
      Returns:
      this.