# Class CloudDatastoreRemoteServiceConfig (5.0.3)

    public abstract class CloudDatastoreRemoteServiceConfig

User-configurable global properties of Cloud Datastore.

Code not running in App Engine Standard can use the Cloud Datastore API by making a single
call to [#setConfig](https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.CloudDatastoreRemoteServiceConfig#com_google_appengine_api_datastore_CloudDatastoreRemoteServiceConfig_setConfig_) before accessing any other classes from [com.google.appengine.api](https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api). For example:


     public static void main(Strings[] args) {
       CloudDatastoreRemoteServiceConfig config = CloudDatastoreRemoteServiceConfig.builder()
           .appId(AppId.create(Location.US_CENTRAL, "my-project-id"))
           .build();
       CloudDatastoreRemoteServiceConfig.setConfig(config);
       DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
       ...
     }
     
Outside of tests, the config should not be cleared once it has been set. In tests, the config can
be cleared by calling [#clear](https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.CloudDatastoreRemoteServiceConfig#com_google_appengine_api_datastore_CloudDatastoreRemoteServiceConfig_clear_):


     {@literal @}Before
     public void before() {
       CloudDatastoreRemoteServiceConfig config = CloudDatastoreRemoteServiceConfig.builder()
           .appId(AppId.create(Location.US_CENTRAL, "my-project-id"))
           .emulatorHost(...)
           .build();
       CloudDatastoreRemoteServiceConfig.setConfig(config);
     }

     {@literal @}After
     public void after() {
       CloudDatastoreRemoteServiceConfig.clear();
     }
     
By default, this configuration uses [application-default
credentials](https://developers.google.com/identity/protocols/application-default-credentials).

## Inheritance

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

## Inherited Members

[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 Methods

### builder()

    public static CloudDatastoreRemoteServiceConfig.Builder builder()

Returns a [CloudDatastoreRemoteServiceConfig.Builder](https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.CloudDatastoreRemoteServiceConfig.Builder).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.CloudDatastoreRemoteServiceConfig.Builder` |   |

### clear()

    public static void clear()

Clears the [CloudDatastoreRemoteServiceConfig](https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.CloudDatastoreRemoteServiceConfig) instance (if one has been set) as well as
the [ApiProxy](https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.apphosting.api.ApiProxy)'s EnvironmentFactory and the Environment for the current
thread.

This method should only be called in tests.

### setConfig(CloudDatastoreRemoteServiceConfig config)

    public static void setConfig(CloudDatastoreRemoteServiceConfig config)

Sets the [CloudDatastoreRemoteServiceConfig](https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.CloudDatastoreRemoteServiceConfig) instance.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `config` | `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.CloudDatastoreRemoteServiceConfig` |

## Constructors

### CloudDatastoreRemoteServiceConfig()

    public CloudDatastoreRemoteServiceConfig()