Package au.org.ala.userdetails
Class UserDetailsClient.Builder
java.lang.Object
au.org.ala.userdetails.UserDetailsClient.Builder
- Enclosing interface:
- UserDetailsClient
A Builder for generating UserDetailsClient instances.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionokhttp3.HttpUrlbaseUrl()build()Create the UserDetailsClient instance.okhttp3.Call.FactoryThe Call.Factory to use for calling the web services.static UserDetailsClient.Buildercom.squareup.moshi.Moshimoshi()moshi(com.squareup.moshi.Moshi moshi)
-
Constructor Details
-
Builder
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 anOkHttpClient)baseUrl- The base URL of the User Details service
-
Builder
public Builder(okhttp3.Call.Factory callFactory, okhttp3.HttpUrl baseUrl) Creates a newBuilderinstance.- 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
-
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
- Returns:
this.
-