Class DatastoreOptions.Builder (2.19.2)

public static class DatastoreOptions.Builder

Builder for DatastoreOptions.

Inheritance

java.lang.Object > DatastoreOptions.Builder

Constructors

Builder()

public Builder()

Builder(DatastoreOptions options)

public Builder(DatastoreOptions options)
Parameter
Name Description
options DatastoreOptions

Methods

build()

public DatastoreOptions build()
Returns
Type Description
DatastoreOptions

credential(Credential credential)

public DatastoreOptions.Builder credential(Credential credential)

Sets the Google APIs Credential used to access Cloud Datastore.

Parameter
Name Description
credential com.google.api.client.auth.oauth2.Credential
Returns
Type Description
DatastoreOptions.Builder

host(String host)

public DatastoreOptions.Builder host(String host)

Sets the host used to access Cloud Datastore. To connect to the Cloud Datastore Emulator, use #localHost instead.

Parameter
Name Description
host String
Returns
Type Description
DatastoreOptions.Builder

initializer(HttpRequestInitializer initializer)

public DatastoreOptions.Builder initializer(HttpRequestInitializer initializer)

Sets the (optional) initializer to run on HTTP requests to Cloud Datastore.

Parameter
Name Description
initializer com.google.api.client.http.HttpRequestInitializer
Returns
Type Description
DatastoreOptions.Builder

localHost(String localHost)

public DatastoreOptions.Builder localHost(String localHost)

Configures the client to access Cloud Datastore on a local host (typically a Cloud Datastore Emulator instance). Call this method also configures the client not to attach credentials to requests.

Parameter
Name Description
localHost String
Returns
Type Description
DatastoreOptions.Builder

projectEndpoint(String projectEndpoint) (deprecated)

public DatastoreOptions.Builder projectEndpoint(String projectEndpoint)

Deprecated. Use #projectId and/or #host/#localHost instead.

Sets the project endpoint used to access Cloud Datastore. Prefer using #projectId and/or #host/#localHost when possible.

Parameter
Name Description
projectEndpoint String
Returns
Type Description
DatastoreOptions.Builder

projectId(String projectId)

public DatastoreOptions.Builder projectId(String projectId)

Sets the project ID used to access Cloud Datastore.

Parameter
Name Description
projectId String
Returns
Type Description
DatastoreOptions.Builder

transport(HttpTransport transport)

public DatastoreOptions.Builder transport(HttpTransport transport)

Sets the transport used to access Cloud Datastore.

Parameter
Name Description
transport com.google.api.client.http.HttpTransport
Returns
Type Description
DatastoreOptions.Builder