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

Commit 3a7e91c

Browse files
chore: generate libraries at Tue Jan 20 22:09:26 UTC 2026
1 parent 617fd11 commit 3a7e91c

4 files changed

Lines changed: 42 additions & 34 deletions

File tree

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/GcRuleBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
/**
2424
* Factory for creating safe GcRule protos.
2525
*
26-
* <p>Use this class to construct GcRules instead of the raw proto builder to avoid
27-
* common pitfalls with "oneof" fields (e.g. accidentally overwriting max age with max versions).
26+
* <p>Use this class to construct GcRules instead of the raw proto builder to avoid common pitfalls
27+
* with "oneof" fields (e.g. accidentally overwriting max age with max versions).
2828
*/
2929
public final class GcRuleBuilder {
3030
private GcRuleBuilder() {} // Static utility

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/IntersectionRuleBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
/**
2323
* Builder for creating an Intersection (AND) GC Rule.
2424
*
25-
* <p>This class ensures type safety when constructing composite rules, preventing
26-
* the misuse of the standard builder's ambiguous setters.
25+
* <p>This class ensures type safety when constructing composite rules, preventing the misuse of the
26+
* standard builder's ambiguous setters.
2727
*/
2828
public final class IntersectionRuleBuilder {
2929
private final Intersection.Builder intersectionBuilder = Intersection.newBuilder();

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UnionRuleBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
/**
2323
* Builder for creating a Union (OR) GC Rule.
2424
*
25-
* <p>This class ensures type safety when constructing composite rules, preventing
26-
* the misuse of the standard builder's ambiguous setters.
25+
* <p>This class ensures type safety when constructing composite rules, preventing the misuse of the
26+
* standard builder's ambiguous setters.
2727
*/
2828
public final class UnionRuleBuilder {
2929
private final Union.Builder unionBuilder = Union.newBuilder();

google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/models/GcRuleBuilderTest.java

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -31,65 +31,73 @@ public class GcRuleBuilderTest {
3131
@Test
3232
public void maxAge_createsCorrectProto() {
3333
GcRule rule = GcRuleBuilder.maxAge(Duration.ofHours(1));
34-
34+
3535
assertThat(rule.hasMaxAge()).isTrue();
3636
assertThat(rule.getMaxAge()).isEqualTo(Durations.fromHours(1));
3737
}
3838

3939
@Test
4040
public void maxVersions_createsCorrectProto() {
4141
GcRule rule = GcRuleBuilder.maxVersions(5);
42-
42+
4343
assertThat(rule.hasMaxNumVersions()).isTrue();
4444
assertThat(rule.getMaxNumVersions()).isEqualTo(5);
4545
}
4646

4747
@Test
4848
public void intersection_buildsNestedRules() {
4949
// Expected Proto structure
50-
GcRule expected = GcRule.newBuilder()
51-
.setIntersection(GcRule.Intersection.newBuilder()
52-
.addRules(GcRule.newBuilder().setMaxNumVersions(1).build())
53-
.addRules(GcRule.newBuilder().setMaxAge(Durations.fromHours(2)).build()))
54-
.build();
50+
GcRule expected =
51+
GcRule.newBuilder()
52+
.setIntersection(
53+
GcRule.Intersection.newBuilder()
54+
.addRules(GcRule.newBuilder().setMaxNumVersions(1).build())
55+
.addRules(GcRule.newBuilder().setMaxAge(Durations.fromHours(2)).build()))
56+
.build();
5557

5658
// Using the new Builder
57-
GcRule actual = GcRuleBuilder.intersection()
58-
.add(GcRuleBuilder.maxVersions(1))
59-
.add(GcRuleBuilder.maxAge(Duration.ofHours(2)))
60-
.build();
59+
GcRule actual =
60+
GcRuleBuilder.intersection()
61+
.add(GcRuleBuilder.maxVersions(1))
62+
.add(GcRuleBuilder.maxAge(Duration.ofHours(2)))
63+
.build();
6164

6265
assertThat(actual).isEqualTo(expected);
6366
}
6467

6568
@Test
6669
public void union_buildsNestedRules() {
6770
// Expected Proto structure
68-
GcRule expected = GcRule.newBuilder()
69-
.setUnion(GcRule.Union.newBuilder()
70-
.addRules(GcRule.newBuilder().setMaxNumVersions(10).build())
71-
.addRules(GcRule.newBuilder().setMaxAge(Durations.fromDays(5)).build()))
72-
.build();
71+
GcRule expected =
72+
GcRule.newBuilder()
73+
.setUnion(
74+
GcRule.Union.newBuilder()
75+
.addRules(GcRule.newBuilder().setMaxNumVersions(10).build())
76+
.addRules(GcRule.newBuilder().setMaxAge(Durations.fromDays(5)).build()))
77+
.build();
7378

7479
// Using the new Builder
75-
GcRule actual = GcRuleBuilder.union()
76-
.add(GcRuleBuilder.maxVersions(10))
77-
.add(GcRuleBuilder.maxAge(Duration.ofDays(5)))
78-
.build();
80+
GcRule actual =
81+
GcRuleBuilder.union()
82+
.add(GcRuleBuilder.maxVersions(10))
83+
.add(GcRuleBuilder.maxAge(Duration.ofDays(5)))
84+
.build();
7985

8086
assertThat(actual).isEqualTo(expected);
8187
}
82-
88+
8389
@Test
8490
public void nestedComplexRules_workCorrectly() {
8591
// Union of (Version(1) OR Intersection(Age(1h) AND Version(5)))
86-
GcRule actual = GcRuleBuilder.union()
87-
.add(GcRuleBuilder.maxVersions(1))
88-
.add(GcRuleBuilder.intersection()
89-
.add(GcRuleBuilder.maxAge(Duration.ofHours(1)))
90-
.add(GcRuleBuilder.maxVersions(5))
91-
.build())
92-
.build();
92+
GcRule actual =
93+
GcRuleBuilder.union()
94+
.add(GcRuleBuilder.maxVersions(1))
95+
.add(
96+
GcRuleBuilder.intersection()
97+
.add(GcRuleBuilder.maxAge(Duration.ofHours(1)))
98+
.add(GcRuleBuilder.maxVersions(5))
99+
.build())
100+
.build();
93101

94102
assertThat(actual.getUnion().getRulesCount()).isEqualTo(2);
95103
assertThat(actual.getUnion().getRules(1).getIntersection().getRulesCount()).isEqualTo(2);

0 commit comments

Comments
 (0)