Class MockGoogleJsonClient.Builder (1.35.0)

public static class MockGoogleJsonClient.Builder extends AbstractGoogleJsonClient.Builder

Beta
Builder for MockGoogleJsonClient.

Implementation is not thread-safe.

Inheritance

java.lang.Object > AbstractGoogleClient.Builder > AbstractGoogleJsonClient.Builder > MockGoogleJsonClient.Builder

Constructors

Builder(HttpTransport transport, JsonFactory jsonFactory, String rootUrl, String servicePath, HttpRequestInitializer httpRequestInitializer, boolean legacyDataWrapper)

public Builder(HttpTransport transport, JsonFactory jsonFactory, String rootUrl, String servicePath, HttpRequestInitializer httpRequestInitializer, boolean legacyDataWrapper)
Parameters
NameDescription
transportcom.google.api.client.http.HttpTransport

HTTP transport

jsonFactorycom.google.api.client.json.JsonFactory

JSON factory

rootUrlString

root URL of the service

servicePathString

service path

httpRequestInitializercom.google.api.client.http.HttpRequestInitializer

HTTP request initializer or null for none

legacyDataWrapperboolean

whether using the legacy data wrapper in responses

Methods

build()

public MockGoogleJsonClient build()

Builds a new instance of AbstractGoogleClient.

Returns
TypeDescription
MockGoogleJsonClient
Overrides

setApplicationName(String applicationName)

public MockGoogleJsonClient.Builder setApplicationName(String applicationName)

Sets the application name to be used in the UserAgent header of each request or null for none.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

Parameter
NameDescription
applicationNameString
Returns
TypeDescription
MockGoogleJsonClient.Builder
Overrides

setGoogleClientRequestInitializer(GoogleClientRequestInitializer googleClientRequestInitializer)

public MockGoogleJsonClient.Builder setGoogleClientRequestInitializer(GoogleClientRequestInitializer googleClientRequestInitializer)

Sets the Google client request initializer or null for none.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

Parameter
NameDescription
googleClientRequestInitializerGoogleClientRequestInitializer
Returns
TypeDescription
MockGoogleJsonClient.Builder
Overrides

setHttpRequestInitializer(HttpRequestInitializer httpRequestInitializer)

public MockGoogleJsonClient.Builder setHttpRequestInitializer(HttpRequestInitializer httpRequestInitializer)

Sets the HTTP request initializer or null for none.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

Parameter
NameDescription
httpRequestInitializercom.google.api.client.http.HttpRequestInitializer
Returns
TypeDescription
MockGoogleJsonClient.Builder
Overrides

setRootUrl(String rootUrl)

public MockGoogleJsonClient.Builder setRootUrl(String rootUrl)

Sets the URL-encoded root URL of the service, for example https://www.googleapis.com/ .

If the specified root URL does not end with a "/" then a "/" is added to the end.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

Parameter
NameDescription
rootUrlString
Returns
TypeDescription
MockGoogleJsonClient.Builder
Overrides

setServicePath(String servicePath)

public MockGoogleJsonClient.Builder setServicePath(String servicePath)

Sets the URL-encoded service path of the service, for example "tasks/v1/".

It is allowed to be an empty string "" or a forward slash "/", if it is a forward slash then it is treated as an empty string. This is determined when the library is generated and normally should not be changed.

If the specified service path does not end with a "/" then a "/" is added to the end. If the specified service path begins with a "/" then the "/" is removed.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

Parameter
NameDescription
servicePathString
Returns
TypeDescription
MockGoogleJsonClient.Builder
Overrides

setSuppressAllChecks(boolean suppressAllChecks)

public MockGoogleJsonClient.Builder setSuppressAllChecks(boolean suppressAllChecks)

Suppresses all discovery pattern and required parameter checks.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

Parameter
NameDescription
suppressAllChecksboolean
Returns
TypeDescription
MockGoogleJsonClient.Builder
Overrides

setSuppressPatternChecks(boolean suppressPatternChecks)

public MockGoogleJsonClient.Builder setSuppressPatternChecks(boolean suppressPatternChecks)

Sets whether discovery pattern checks should be suppressed on required parameters.

Default value is false.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

Parameter
NameDescription
suppressPatternChecksboolean
Returns
TypeDescription
MockGoogleJsonClient.Builder
Overrides

setSuppressRequiredParameterChecks(boolean suppressRequiredParameterChecks)

public MockGoogleJsonClient.Builder setSuppressRequiredParameterChecks(boolean suppressRequiredParameterChecks)

Sets whether discovery required parameter checks should be suppressed.

Default value is false.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.

Parameter
NameDescription
suppressRequiredParameterChecksboolean
Returns
TypeDescription
MockGoogleJsonClient.Builder
Overrides