Skip to content

Commit bc532f3

Browse files
authored
fix: Remove some remaining BsonTimestampValue mentions. (#3)
1 parent 39e1005 commit bc532f3

File tree

7 files changed

+14
-12
lines changed

7 files changed

+14
-12
lines changed

google-cloud-firestore/src/main/java/com/google/cloud/firestore/BsonBinaryData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public int hashCode() {
119119
@Nonnull
120120
@Override
121121
public String toString() {
122-
return "BsonBinaryData{subtype=" + this.subtype + ", data=" + this.data.toString() + " }";
122+
return "BsonBinaryData{subtype=" + this.subtype + ", data=" + this.data.toString() + "}";
123123
}
124124

125125
MapValue toProto() {

google-cloud-firestore/src/main/java/com/google/cloud/firestore/BsonTimestamp.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ public BsonTimestamp(long seconds, long increment) {
4747
}
4848

4949
MapValue toProto() {
50-
return UserDataConverter.encodeBsonTimestampValue(seconds, increment);
50+
return UserDataConverter.encodeBsonTimestamp(seconds, increment);
5151
}
5252

5353
/**
54-
* Returns true if this BsonTimestampValue is equal to the provided object.
54+
* Returns true if this BsonTimestamp is equal to the provided object.
5555
*
5656
* @param obj The object to compare against.
57-
* @return Whether this BsonTimestampValue is equal to the provided object.
57+
* @return Whether this BsonTimestamp is equal to the provided object.
5858
*/
5959
@Override
6060
public boolean equals(Object obj) {

google-cloud-firestore/src/main/java/com/google/cloud/firestore/DocumentSnapshot.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,14 +459,14 @@ public BsonObjectId getBsonObjectId(@Nonnull String field) {
459459
}
460460

461461
/**
462-
* Returns the value of the field as a BsonTimestampValue.
462+
* Returns the value of the field as a BsonTimestamp.
463463
*
464464
* @param field The path to the field.
465-
* @throws RuntimeException if the value is not a BsonTimestampValue.
465+
* @throws RuntimeException if the value is not a BsonTimestamp.
466466
* @return The value of the field.
467467
*/
468468
@Nullable
469-
public BsonTimestamp getBsonTimestampValue(@Nonnull String field) {
469+
public BsonTimestamp getBsonTimestamp(@Nonnull String field) {
470470
return (BsonTimestamp) get(field);
471471
}
472472

google-cloud-firestore/src/main/java/com/google/cloud/firestore/UserDataConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ static MapValue encodeBsonObjectId(String oid) {
290290
.build();
291291
}
292292

293-
static MapValue encodeBsonTimestampValue(long seconds, long increment) {
293+
static MapValue encodeBsonTimestamp(long seconds, long increment) {
294294
return MapValue.newBuilder()
295295
.putFields(
296296
MapType.RESERVED_BSON_TIMESTAMP_KEY,

google-cloud-firestore/src/main/java/com/google/cloud/firestore/encoding/CustomClassMapper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ private static <T> T deserializeToClass(Object o, Class<T> clazz, DeserializeCon
340340
} else if (BsonObjectId.class.isAssignableFrom(clazz)) {
341341
return (T) convertBsonObjectId(o, context.errorPath);
342342
} else if (BsonTimestamp.class.isAssignableFrom(clazz)) {
343-
return (T) convertBsonTimestampValue(o, context.errorPath);
343+
return (T) convertBsonTimestamp(o, context.errorPath);
344344
} else if (BsonBinaryData.class.isAssignableFrom(clazz)) {
345345
return (T) convertBsonBinaryData(o, context.errorPath);
346346
} else if (DocumentReference.class.isAssignableFrom(clazz)) {
@@ -661,13 +661,13 @@ private static BsonObjectId convertBsonObjectId(
661661
}
662662
}
663663

664-
private static BsonTimestamp convertBsonTimestampValue(
664+
private static BsonTimestamp convertBsonTimestamp(
665665
Object o, DeserializeContext.ErrorPath errorPath) {
666666
if (o instanceof BsonTimestamp) {
667667
return (BsonTimestamp) o;
668668
} else {
669669
throw errorPath.deserializeError(
670-
"Failed to convert value of type " + o.getClass().getName() + " to BsonTimestampValue");
670+
"Failed to convert value of type " + o.getClass().getName() + " to BsonTimestamp");
671671
}
672672
}
673673

google-cloud-firestore/src/test/java/com/google/cloud/firestore/OrderTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ public void verifyOrder() {
157157
groups.add(new Value[] {objectValue("bar", intValue(2))});
158158
groups.add(new Value[] {objectValue("bar", stringValue("0"))});
159159

160+
groups.add(new Value[] {maxKeyValue(), maxKeyValue()});
161+
160162
for (int left = 0; left < groups.size(); left++) {
161163
for (int right = 0; right < groups.size(); right++) {
162164
for (int i = 0; i < groups.get(left).length; i++) {

google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITSystemTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2353,7 +2353,7 @@ public void canWriteAndReadBackBsonObjectId() throws Exception {
23532353
}
23542354

23552355
@Test
2356-
public void canWriteAndReadBackBsonTimestampValue() throws Exception {
2356+
public void canWriteAndReadBackBsonTimestamp() throws Exception {
23572357
checkRoundTrip(FieldValue.bsonTimestamp(123, 45));
23582358
}
23592359

0 commit comments

Comments
 (0)