Skip to content

Commit a821e2f

Browse files
---
yaml --- r: 9891 b: refs/heads/mrschmidt-options c: e96c50a h: refs/heads/master i: 9889: 5e24aae 9887: b96a825
1 parent 4519098 commit a821e2f

2 files changed

Lines changed: 21 additions & 13 deletions

File tree

  • branches/mrschmidt-options/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ refs/tags/v0.45.0: 4b4eb52d0823f5335cb8acf54a88bae199e013ae
9595
refs/tags/v0.46.0: 40dfc83a11b2cf2c21bf0f5a7b1e47087cbf0259
9696
refs/tags/0.47.0: 2e8688416bcae6150c0fa59936103554dbbe3821
9797
refs/heads/mrschmidt-core-timestamps: 19c1eca95467e588c21378cae2b136d14973d532
98-
refs/heads/mrschmidt-options: 19f5e67695f02f7941410ec78947a673c0c235f9
98+
refs/heads/mrschmidt-options: e96c50a91e308b4f2b86301f032de22e06b0edb0
9999
refs/heads/mrschmidt-timestamps: d50ea25fe0537a4e4bf161e0e27ab978a361ed47
100100
refs/tags/v0.48.0: 94a4b5648607953030555908d301c57e79c5afca
101101
refs/tags/v0.49.0: 6f75996bb3386bd4dac3d796497b10d24507ccd3

branches/mrschmidt-options/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreOptions.java

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -169,16 +169,6 @@ public Builder setCredentialsProvider(@Nonnull CredentialsProvider credentialsPr
169169
return this;
170170
}
171171

172-
/**
173-
* Sets the database ID to use with this Firestore client.
174-
*
175-
* @param databaseId The Firestore database ID to use with this client.
176-
*/
177-
public Builder setDatabaseId(@Nonnull String databaseId) {
178-
this.databaseId = databaseId;
179-
return this;
180-
}
181-
182172
/**
183173
* Enables the use of {@link com.google.cloud.Timestamp Timestamps} for timestamp fields in
184174
* {@link DocumentSnapshot DocumentSnapshots}.
@@ -206,6 +196,17 @@ public Builder setTimestampsInSnapshotsEnabled(boolean value) {
206196
return this;
207197
}
208198

199+
/**
200+
* Sets the database ID to use with this Firestore client.
201+
*
202+
* @param databaseId The Firestore database ID to use with this client.
203+
*/
204+
@Nonnull
205+
public Builder setDatabaseId(@Nonnull String databaseId) {
206+
this.databaseId = databaseId;
207+
return this;
208+
}
209+
209210
@Override
210211
@Nonnull
211212
public FirestoreOptions build() {
@@ -218,9 +219,9 @@ protected FirestoreOptions(Builder builder) {
218219
super(FirestoreFactory.class, FirestoreRpcFactory.class, builder, new FirestoreDefaults());
219220

220221
this.databaseId = builder.databaseId;
222+
this.timestampsInSnapshotsEnabled = builder.timestampsInSnapshotsEnabled;
221223
this.channelProvider = builder.channelProvider;
222224
this.credentialsProvider = builder.credentialsProvider;
223-
this.timestampsInSnapshotsEnabled = builder.timestampsInSnapshotsEnabled;
224225
}
225226

226227
private static class FirestoreDefaults implements ServiceDefaults<Firestore, FirestoreOptions> {
@@ -317,12 +318,19 @@ public boolean equals(Object o) {
317318
FirestoreOptions that = (FirestoreOptions) o;
318319
return Objects.equals(databaseId, that.databaseId)
319320
&& Objects.equals(channelProvider, that.channelProvider)
321+
&& Objects.equals(credentialsProvider, that.credentialsProvider)
322+
&& Objects.equals(timestampsInSnapshotsEnabled, that.timestampsInSnapshotsEnabled)
320323
&& baseEquals(that);
321324
}
322325

323326
@Override
324327
public int hashCode() {
325-
return Objects.hash(databaseId, channelProvider, baseHashCode());
328+
return Objects.hash(
329+
databaseId,
330+
channelProvider,
331+
credentialsProvider,
332+
timestampsInSnapshotsEnabled,
333+
baseHashCode());
326334
}
327335

328336
@Nonnull

0 commit comments

Comments
 (0)