3535public class DatastoreOptions extends ServiceOptions <DatastoreRpc , DatastoreOptions > {
3636
3737 private static final long serialVersionUID = -8636602944160689193L ;
38- private static final String DATASET_ENV_NAME = "DATASTORE_DATASET" ;
39- private static final String HOST_ENV_NAME = "DATASTORE_HOST" ;
4038 private static final String DATASTORE_SCOPE = "https://www.googleapis.com/auth/datastore" ;
4139 private static final String USERINFO_SCOPE = "https://www.googleapis.com/auth/userinfo.email" ;
4240 private static final Set <String > SCOPES = ImmutableSet .of (DATASTORE_SCOPE , USERINFO_SCOPE );
4341
4442 private final String namespace ;
45- private final boolean force ;
4643 private final boolean normalizeDataset ;
4744 private transient DatastoreRpc datastoreRpc ;
4845
4946 public static class Builder extends
5047 ServiceOptions .Builder <DatastoreRpc , DatastoreOptions , Builder > {
5148
5249 private String namespace ;
53- private boolean force ;
5450 private boolean normalizeDataset = true ;
5551
5652 private Builder () {
5753 }
5854
5955 private Builder (DatastoreOptions options ) {
6056 super (options );
61- force = options .force ;
6257 namespace = options .namespace ;
6358 normalizeDataset = options .normalizeDataset ;
6459 }
@@ -74,11 +69,6 @@ public Builder namespace(String namespace) {
7469 return this ;
7570 }
7671
77- public Builder force (boolean force ) {
78- this .force = force ;
79- return this ;
80- }
81-
8272 Builder normalizeDataset (boolean normalizeDataset ) {
8373 this .normalizeDataset = normalizeDataset ;
8474 return this ;
@@ -89,7 +79,6 @@ private DatastoreOptions(Builder builder) {
8979 super (builder );
9080 normalizeDataset = builder .normalizeDataset ;
9181 namespace = builder .namespace != null ? builder .namespace : defaultNamespace ();
92- force = builder .force ;
9382 }
9483
9584 private DatastoreOptions normalize () {
@@ -126,13 +115,17 @@ private DatastoreOptions normalize() {
126115
127116 @ Override
128117 protected String defaultHost () {
129- String host = System .getProperty (HOST_ENV_NAME , System .getenv (HOST_ENV_NAME ));
118+ String host = System .getProperty (
119+ com .google .datastore .v1beta3 .client .DatastoreHelper .LOCAL_HOST_ENV_VAR ,
120+ System .getenv (com .google .datastore .v1beta3 .client .DatastoreHelper .LOCAL_HOST_ENV_VAR ));
130121 return host != null ? host : super .defaultHost ();
131122 }
132123
133124 @ Override
134125 protected String defaultProject () {
135- String projectId = System .getProperty (DATASET_ENV_NAME , System .getenv (DATASET_ENV_NAME ));
126+ String projectId = System .getProperty (
127+ com .google .datastore .v1beta3 .client .DatastoreHelper .PROJECT_ID_ENV_VAR ,
128+ System .getenv (com .google .datastore .v1beta3 .client .DatastoreHelper .PROJECT_ID_ENV_VAR ));
136129 if (projectId == null ) {
137130 projectId = appEngineAppId ();
138131 }
@@ -157,10 +150,6 @@ private static String defaultNamespace() {
157150 }
158151 }
159152
160- public boolean force () {
161- return force ;
162- }
163-
164153 @ Override
165154 protected Set <String > scopes () {
166155 return SCOPES ;
@@ -173,7 +162,7 @@ public Builder toBuilder() {
173162
174163 @ Override
175164 public int hashCode () {
176- return baseHashCode () ^ Objects .hash (namespace , force , normalizeDataset );
165+ return baseHashCode () ^ Objects .hash (namespace , normalizeDataset );
177166 }
178167
179168 @ Override
@@ -183,7 +172,6 @@ public boolean equals(Object obj) {
183172 }
184173 DatastoreOptions other = (DatastoreOptions ) obj ;
185174 return baseEquals (other ) && Objects .equals (namespace , other .namespace )
186- && Objects .equals (force , other .force )
187175 && Objects .equals (normalizeDataset , other .normalizeDataset );
188176 }
189177
0 commit comments