Package com.microsoft.graph.core
Class BaseClient.Builder<httpClientType,nativeRequestType>
java.lang.Object
com.microsoft.graph.core.BaseClient.Builder<httpClientType,nativeRequestType>
- Type Parameters:
httpClientType- type of the native http library clientnativeRequestType- type of a request for the native http client
- Enclosing class:
BaseClient<nativeRequestType>
Builder to help configure the Graph service client
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the authentication providerBuilds and returns the Graph service client.protected <ClientType extends BaseClient<nativeRequestType>>
ClientTypebuildClient(ClientType instance) Builds and returns the Graph service client.httpClient(httpClientType client) Sets the http clienthttpProvider(IHttpProvider<nativeRequestType> httpProvider) Sets the httpProviderSets the loggerserializer(ISerializer serializer) Sets the serializer.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
serializer
@Nonnull public BaseClient.Builder<httpClientType,nativeRequestType> serializer(@Nonnull ISerializer serializer) Sets the serializer.- Parameters:
serializer- the serializer- Returns:
- the instance of this builder
-
httpProvider
@Nonnull public BaseClient.Builder<httpClientType,nativeRequestType> httpProvider(@Nonnull IHttpProvider<nativeRequestType> httpProvider) Sets the httpProvider- Parameters:
httpProvider- the httpProvider- Returns:
- the instance of this builder
-
logger
@Nonnull public BaseClient.Builder<httpClientType,nativeRequestType> logger(@Nonnull ILogger logger) Sets the logger- Parameters:
logger- the logger- Returns:
- the instance of this builder
-
httpClient
@Nonnull public BaseClient.Builder<httpClientType,nativeRequestType> httpClient(@Nonnull httpClientType client) Sets the http client- Parameters:
client- the http client- Returns:
- the instance of this builder
-
authenticationProvider
@Nonnull public BaseClient.Builder<httpClientType,nativeRequestType> authenticationProvider(@Nonnull IAuthenticationProvider auth) Sets the authentication provider- Parameters:
auth- the authentication provider- Returns:
- the instance of this builder
-
buildClient
@Nonnull protected <ClientType extends BaseClient<nativeRequestType>> ClientType buildClient(@Nonnull ClientType instance) throws ClientException Builds and returns the Graph service client.- Type Parameters:
ClientType- the type of the client to return- Parameters:
instance- the instance to set the information for- Returns:
- the Graph service client object
- Throws:
ClientException- if there was an exception creating the client
-
buildClient
Builds and returns the Graph service client.- Returns:
- the Graph service client object
- Throws:
ClientException- if there was an exception creating the client
-