# Class DatastoreOptions (3.1.0)

3.1.0 (latest) 2.40.0 2.37.0 2.36.0 2.34.0 2.33.3 2.32.3 2.31.4 2.30.0 2.29.1 2.28.2 2.27.1 2.26.4 2.25.2 2.24.3 2.23.0 2.22.0 2.21.3 2.20.2 2.19.2 2.18.5 2.17.6

    public class DatastoreOptions extends ServiceOptions<Datastore,DatastoreOptions>

## Inheritance

[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> com.google.cloud.ServiceOptions \> DatastoreOptions

## Inherited Members

com.google.cloud.ServiceOptions.\<B\>toBuilder() com.google.cloud.ServiceOptions.\<T\>getFromServiceLoader(java.lang.Class\<? extends T\>,T) com.google.cloud.ServiceOptions.\<T\>newInstance(java.lang.String) com.google.cloud.ServiceOptions.baseEquals(com.google.cloud.ServiceOptions\<?,?\>) com.google.cloud.ServiceOptions.baseHashCode() com.google.cloud.ServiceOptions.defaultRetrySettings() com.google.cloud.ServiceOptions.getApiTracerFactory() com.google.cloud.ServiceOptions.getAppEngineAppId() com.google.cloud.ServiceOptions.getAppEngineProjectId() com.google.cloud.ServiceOptions.getAppEngineProjectIdFromAppId() com.google.cloud.ServiceOptions.getApplicationName() com.google.cloud.ServiceOptions.getClientLibToken() com.google.cloud.ServiceOptions.getClock() com.google.cloud.ServiceOptions.getCredentials() com.google.cloud.ServiceOptions.getDefaultHost() com.google.cloud.ServiceOptions.getDefaultProject() com.google.cloud.ServiceOptions.getDefaultProjectId() com.google.cloud.ServiceOptions.getDefaultRetrySettings() com.google.cloud.ServiceOptions.getGoogApiClientLibName() com.google.cloud.ServiceOptions.getGoogleCloudProjectId() com.google.cloud.ServiceOptions.getHost() com.google.cloud.ServiceOptions.getLibraryName() com.google.cloud.ServiceOptions.getLibraryVersion() com.google.cloud.ServiceOptions.getMergedHeaderProvider(com.google.api.gax.rpc.HeaderProvider) com.google.cloud.ServiceOptions.getNoRetrySettings() com.google.cloud.ServiceOptions.getProjectId() com.google.cloud.ServiceOptions.getQuotaProjectId() com.google.cloud.ServiceOptions.getResolvedApiaryHost(java.lang.String) com.google.cloud.ServiceOptions.getResolvedHost(java.lang.String) com.google.cloud.ServiceOptions.getRetrySettings() com.google.cloud.ServiceOptions.getRpc() com.google.cloud.ServiceOptions.getScopedCredentials() com.google.cloud.ServiceOptions.getScopes() com.google.cloud.ServiceOptions.getService() com.google.cloud.ServiceOptions.getServiceAccountProjectId() com.google.cloud.ServiceOptions.getTransportOptions() com.google.cloud.ServiceOptions.getUniverseDomain() com.google.cloud.ServiceOptions.getUserAgent() com.google.cloud.ServiceOptions.hasValidUniverseDomain() com.google.cloud.ServiceOptions.projectIdRequired() com.google.cloud.ServiceOptions.shouldRefreshRpc(com.google.cloud.ServiceRpc) com.google.cloud.ServiceOptions.shouldRefreshService(ServiceT) [Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Fields

### INIT_CHANNEL_COUNT

    public static final int INIT_CHANNEL_COUNT

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### LOCAL_HOST_ENV_VAR

    public static final String LOCAL_HOST_ENV_VAR

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### MAX_CHANNEL_COUNT (deprecated)

    public static final int MAX_CHANNEL_COUNT

**Deprecated.** *This constant is obsolete and will be removed in a future version.*

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### MIN_CHANNEL_COUNT

    public static final int MIN_CHANNEL_COUNT

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### PROJECT_ID_ENV_VAR

    public static final String PROJECT_ID_ENV_VAR

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

## Static Methods

### getDefaultGrpcTransportOptions()

    public static GrpcTransportOptions getDefaultGrpcTransportOptions()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.cloud.grpc.GrpcTransportOptions` |   |

### getDefaultHttpTransportOptions()

    public static HttpTransportOptions getDefaultHttpTransportOptions()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.cloud.http.HttpTransportOptions` |   |

### getDefaultInstance()

    public static DatastoreOptions getDefaultInstance()

Returns a default `DatastoreOptions` instance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.DatastoreOptions` |   |

### newBuilder()

    public static DatastoreOptions.Builder newBuilder()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.DatastoreOptions.Builder` |   |

## Methods

### equals(Object obj)

    public boolean equals(Object obj)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `obj` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-)

### getDatabaseId()

    public String getDatabaseId()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getDatastoreRpcV1()

    protected DatastoreRpc getDatastoreRpcV1()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.spi.v1.DatastoreRpc` |   |

### getDefaultHost()

    protected String getDefaultHost()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

**Overrides** com.google.cloud.ServiceOptions.getDefaultHost()

### getDefaultProject()

    protected String getDefaultProject()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

**Overrides** com.google.cloud.ServiceOptions.getDefaultProject()

### getNamespace()

    public String getNamespace()

Returns the default namespace to be used by the datastore service.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getOpenTelemetryOptions()

    public DatastoreOpenTelemetryOptions getOpenTelemetryOptions()

> [!WARNING]
> **Beta**
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.DatastoreOpenTelemetryOptions` |   |

### getScopes()

    protected Set<String> getScopes()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Set.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |   |

**Overrides** com.google.cloud.ServiceOptions.getScopes()

### getTransportChannelProvider()

    public TransportChannelProvider getTransportChannelProvider()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.TransportChannelProvider.html` |   |

### hashCode()

    public int hashCode()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--)

### toBuilder()

    public DatastoreOptions.Builder toBuilder()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.DatastoreOptions.Builder` |   |

**Overrides** com.google.cloud.ServiceOptions.\<B\>toBuilder()