Class DatastoreOptions.Builder (2.17.6)

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
NameDescription
optionsDatastoreOptions

Methods

build()

public DatastoreOptions build()
Returns
TypeDescription
DatastoreOptions

credential(Credential credential)

public DatastoreOptions.Builder credential(Credential credential)

Sets the Google APIs Credential used to access Cloud Datastore.

Parameter
NameDescription
credentialcom.google.api.client.auth.oauth2.Credential
Returns
TypeDescription
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
NameDescription
hostString
Returns
TypeDescription
DatastoreOptions.Builder

initializer(HttpRequestInitializer initializer)

public DatastoreOptions.Builder initializer(HttpRequestInitializer initializer)

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

Parameter
NameDescription
initializercom.google.api.client.http.HttpRequestInitializer
Returns
TypeDescription
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
NameDescription
localHostString
Returns
TypeDescription
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
NameDescription
projectEndpointString
Returns
TypeDescription
DatastoreOptions.Builder

projectId(String projectId)

public DatastoreOptions.Builder projectId(String projectId)

Sets the project ID used to access Cloud Datastore.

Parameter
NameDescription
projectIdString
Returns
TypeDescription
DatastoreOptions.Builder

transport(HttpTransport transport)

public DatastoreOptions.Builder transport(HttpTransport transport)

Sets the transport used to access Cloud Datastore.

Parameter
NameDescription
transportcom.google.api.client.http.HttpTransport
Returns
TypeDescription
DatastoreOptions.Builder