Skip to content

Commit e96c50a

Browse files
Updating hash()
1 parent 19f5e67 commit e96c50a

1 file changed

Lines changed: 20 additions & 12 deletions

File tree

  • google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore

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)