Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Commit 7ee7361

Browse files
chore: generate libraries at Fri Feb 27 16:50:25 UTC 2026
1 parent 0650c71 commit 7ee7361

4 files changed

Lines changed: 111 additions & 104 deletions

File tree

google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/expressions/Expression.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3132,12 +3132,14 @@ public static Expression type(String fieldName) {
31323132

31333133
@BetaApi
31343134
public static BooleanExpression isType(Expression expr, Type type) {
3135-
return new BooleanFunctionExpression("is_type", ImmutableList.of(expr, constant(type.name().toLowerCase())));
3135+
return new BooleanFunctionExpression(
3136+
"is_type", ImmutableList.of(expr, constant(type.name().toLowerCase())));
31363137
}
31373138

31383139
@BetaApi
31393140
public static BooleanExpression isType(String fieldName, Type type) {
3140-
return new BooleanFunctionExpression("is_type", ImmutableList.of(field(fieldName), constant(type.name().toLowerCase())));
3141+
return new BooleanFunctionExpression(
3142+
"is_type", ImmutableList.of(field(fieldName), constant(type.name().toLowerCase())));
31413143
}
31423144

31433145
// Numeric Operations
@@ -4808,5 +4810,7 @@ public final Expression type() {
48084810
}
48094811

48104812
@BetaApi
4811-
public final Expression isType(Type type) { return isType(this, type); }
4813+
public final Expression isType(Type type) {
4814+
return isType(this, type);
4815+
}
48124816
}

google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/expressions/Type.java

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,27 @@
22

33
import com.google.api.core.BetaApi;
44

5-
/**
6-
* An enumeration of the different types generated by the Firestore backend.
7-
*/
5+
/** An enumeration of the different types generated by the Firestore backend. */
86
@BetaApi
97
public enum Type {
10-
NULL,
11-
ARRAY,
12-
BOOLEAN,
13-
BYTES,
14-
TIMESTAMP,
15-
GEO_POINT,
16-
NUMBER,
17-
INT32,
18-
INT64,
19-
FLOAT64,
20-
DECIMAL128,
21-
MAP,
22-
REFERENCE,
23-
STRING,
24-
VECTOR,
25-
MAX_KEY,
26-
MIN_KEY,
27-
OBJECT_ID,
28-
REGEX,
29-
REQUEST_TIMESTAMP,
8+
NULL,
9+
ARRAY,
10+
BOOLEAN,
11+
BYTES,
12+
TIMESTAMP,
13+
GEO_POINT,
14+
NUMBER,
15+
INT32,
16+
INT64,
17+
FLOAT64,
18+
DECIMAL128,
19+
MAP,
20+
REFERENCE,
21+
STRING,
22+
VECTOR,
23+
MAX_KEY,
24+
MIN_KEY,
25+
OBJECT_ID,
26+
REGEX,
27+
REQUEST_TIMESTAMP,
3028
}
31-

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

Lines changed: 77 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2637,78 +2637,84 @@ public void testType() throws Exception {
26372637
@Test
26382638
public void testIsType() throws Exception {
26392639
List<PipelineResult> results =
2640-
firestore
2641-
.pipeline()
2642-
.collection(collection.getPath())
2643-
.replaceWith(Expression.map(
2644-
map(
2645-
"int", 1,
2646-
"float", 1.1,
2647-
"str", "a string",
2648-
"bool", true,
2649-
"null", null,
2650-
"geoPoint", new GeoPoint(0.1, 0.2),
2651-
"timestamp", Timestamp.ofTimeSecondsAndNanos(123456, 0),
2652-
"bytes", com.google.cloud.firestore.Blob.fromBytes(new byte[]{1, 2 ,3}),
2653-
"docRef", collection.document("bar"),
2654-
"vector", vector(new double[] {1.0, 2.0, 3.0}),
2655-
"map", Expression.map(map("numberK", 1, "stringK", "a string")),
2656-
"array", array(1, 2, true)
2657-
)
2658-
))
2659-
.select(
2660-
Expression.isType("int", Type.INT64).as("isInt64"),
2661-
Expression.isType("int", Type.NUMBER).as("isInt64IsNumber"),
2662-
Expression.isType("int", Type.DECIMAL128).as("isInt64IsDecimal128"),
2663-
Expression.isType("float", Type.FLOAT64).as("isFloat64"),
2664-
Expression.isType("float", Type.NUMBER).as("isFloat64IsNumber"),
2665-
Expression.isType("float", Type.DECIMAL128).as("isFloat64IsDecimal128"),
2666-
Expression.isType("str", Type.STRING).as("isStr"),
2667-
Expression.isType("str", Type.INT64).as("isStrNum"),
2668-
Expression.isType("int", Type.STRING).as("isNumStr"),
2669-
Expression.isType("bool", Type.BOOLEAN).as("isBool"),
2670-
Expression.isType("null", Type.NULL).as("isNull"),
2671-
Expression.isType("geoPoint", Type.GEO_POINT).as("isGeoPoint"),
2672-
Expression.isType("timestamp", Type.TIMESTAMP).as("isTimestamp"),
2673-
Expression.isType("bytes", Type.BYTES).as("isBytes"),
2674-
Expression.isType("docRef", Type.REFERENCE).as("isDocRef"),
2675-
Expression.isType("vector", Type.VECTOR).as("isVector"),
2676-
Expression.isType("map", Type.MAP).as("isMap"),
2677-
Expression.isType("array", Type.ARRAY).as("isArray"),
2678-
2679-
Expression.isType(constant(1), Type.INT64).as("exprIsInt64"),
2680-
field("int").isType(Type.INT64).as("staticIsInt64")
2681-
)
2682-
.limit(1)
2683-
.execute()
2684-
.get()
2685-
.getResults();
2686-
assertThat(data(results))
2687-
.containsExactly(
2640+
firestore
2641+
.pipeline()
2642+
.collection(collection.getPath())
2643+
.replaceWith(
2644+
Expression.map(
26882645
map(
2689-
"isInt64", true,
2690-
"isInt64IsNumber", true,
2691-
"isInt64IsDecimal128", false,
2692-
"isFloat64", true,
2693-
"isFloat64IsNumber", true,
2694-
"isFloat64IsDecimal128", false,
2695-
"isStr", true,
2696-
"isStrNum", false,
2697-
"isNumStr", false,
2698-
"isBool", true,
2699-
"isNull", true,
2700-
"isGeoPoint", true,
2701-
"isTimestamp", true,
2702-
"isBytes", true,
2703-
"isDocRef", true,
2704-
"isVector", true,
2705-
"isMap", true,
2706-
"isArray", true,
2707-
2708-
"exprIsInt64", true,
2709-
"staticIsInt64", true
2710-
)
2711-
);
2646+
"int",
2647+
1,
2648+
"float",
2649+
1.1,
2650+
"str",
2651+
"a string",
2652+
"bool",
2653+
true,
2654+
"null",
2655+
null,
2656+
"geoPoint",
2657+
new GeoPoint(0.1, 0.2),
2658+
"timestamp",
2659+
Timestamp.ofTimeSecondsAndNanos(123456, 0),
2660+
"bytes",
2661+
com.google.cloud.firestore.Blob.fromBytes(new byte[] {1, 2, 3}),
2662+
"docRef",
2663+
collection.document("bar"),
2664+
"vector",
2665+
vector(new double[] {1.0, 2.0, 3.0}),
2666+
"map",
2667+
Expression.map(map("numberK", 1, "stringK", "a string")),
2668+
"array",
2669+
array(1, 2, true))))
2670+
.select(
2671+
Expression.isType("int", Type.INT64).as("isInt64"),
2672+
Expression.isType("int", Type.NUMBER).as("isInt64IsNumber"),
2673+
Expression.isType("int", Type.DECIMAL128).as("isInt64IsDecimal128"),
2674+
Expression.isType("float", Type.FLOAT64).as("isFloat64"),
2675+
Expression.isType("float", Type.NUMBER).as("isFloat64IsNumber"),
2676+
Expression.isType("float", Type.DECIMAL128).as("isFloat64IsDecimal128"),
2677+
Expression.isType("str", Type.STRING).as("isStr"),
2678+
Expression.isType("str", Type.INT64).as("isStrNum"),
2679+
Expression.isType("int", Type.STRING).as("isNumStr"),
2680+
Expression.isType("bool", Type.BOOLEAN).as("isBool"),
2681+
Expression.isType("null", Type.NULL).as("isNull"),
2682+
Expression.isType("geoPoint", Type.GEO_POINT).as("isGeoPoint"),
2683+
Expression.isType("timestamp", Type.TIMESTAMP).as("isTimestamp"),
2684+
Expression.isType("bytes", Type.BYTES).as("isBytes"),
2685+
Expression.isType("docRef", Type.REFERENCE).as("isDocRef"),
2686+
Expression.isType("vector", Type.VECTOR).as("isVector"),
2687+
Expression.isType("map", Type.MAP).as("isMap"),
2688+
Expression.isType("array", Type.ARRAY).as("isArray"),
2689+
Expression.isType(constant(1), Type.INT64).as("exprIsInt64"),
2690+
field("int").isType(Type.INT64).as("staticIsInt64"))
2691+
.limit(1)
2692+
.execute()
2693+
.get()
2694+
.getResults();
2695+
assertThat(data(results))
2696+
.containsExactly(
2697+
map(
2698+
"isInt64", true,
2699+
"isInt64IsNumber", true,
2700+
"isInt64IsDecimal128", false,
2701+
"isFloat64", true,
2702+
"isFloat64IsNumber", true,
2703+
"isFloat64IsDecimal128", false,
2704+
"isStr", true,
2705+
"isStrNum", false,
2706+
"isNumStr", false,
2707+
"isBool", true,
2708+
"isNull", true,
2709+
"isGeoPoint", true,
2710+
"isTimestamp", true,
2711+
"isBytes", true,
2712+
"isDocRef", true,
2713+
"isVector", true,
2714+
"isMap", true,
2715+
"isArray", true,
2716+
"exprIsInt64", true,
2717+
"staticIsInt64", true));
27122718
}
27132719

27142720
@Test

samples/preview-snippets/src/main/java/com/example/firestore/PipelineSnippets.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,12 +1555,12 @@ void vectorLengthFunction() throws ExecutionException, InterruptedException {
15551555
void isTypeFunction() throws ExecutionException, InterruptedException {
15561556
// [START vector_length]
15571557
Pipeline.Snapshot result =
1558-
firestore
1559-
.pipeline()
1560-
.collection("books")
1561-
.select(field("rating").isType(Type.INT64).as("isRatingInt64"))
1562-
.execute()
1563-
.get();
1558+
firestore
1559+
.pipeline()
1560+
.collection("books")
1561+
.select(field("rating").isType(Type.INT64).as("isRatingInt64"))
1562+
.execute()
1563+
.get();
15641564
// [END vector_length]
15651565
System.out.println(result.getResults());
15661566
}

0 commit comments

Comments
 (0)