Skip to content

Commit a51a8e9

Browse files
chore: generate libraries at Tue Jan 20 22:02:35 UTC 2026
1 parent 026f512 commit a51a8e9

File tree

4 files changed

+42
-34
lines changed

4 files changed

+42
-34
lines changed

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
@@ -22,8 +22,8 @@
2222
/**
2323
* Factory for creating safe GcRule protos.
2424
*
25-
* <p>Use this class to construct GcRules instead of the raw proto builder to avoid
26-
* common pitfalls with "oneof" fields (e.g. accidentally overwriting max age with max versions).
25+
* <p>Use this class to construct GcRules instead of the raw proto builder to avoid common pitfalls
26+
* with "oneof" fields (e.g. accidentally overwriting max age with max versions).
2727
*/
2828
public final class GcRuleBuilder {
2929
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
@@ -21,8 +21,8 @@
2121
/**
2222
* Builder for creating an Intersection (AND) GC Rule.
2323
*
24-
* <p>This class ensures type safety when constructing composite rules, preventing
25-
* the misuse of the standard builder's ambiguous setters.
24+
* <p>This class ensures type safety when constructing composite rules, preventing the misuse of the
25+
* standard builder's ambiguous setters.
2626
*/
2727
public final class IntersectionRuleBuilder {
2828
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
@@ -21,8 +21,8 @@
2121
/**
2222
* Builder for creating a Union (OR) GC Rule.
2323
*
24-
* <p>This class ensures type safety when constructing composite rules, preventing
25-
* the misuse of the standard builder's ambiguous setters.
24+
* <p>This class ensures type safety when constructing composite rules, preventing the misuse of the
25+
* standard builder's ambiguous setters.
2626
*/
2727
public final class UnionRuleBuilder {
2828
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
@@ -30,65 +30,73 @@ public class GcRuleBuilderTest {
3030
@Test
3131
public void maxAge_createsCorrectProto() {
3232
GcRule rule = GcRuleBuilder.maxAge(Duration.ofHours(1));
33-
33+
3434
assertThat(rule.hasMaxAge()).isTrue();
3535
assertThat(rule.getMaxAge()).isEqualTo(Durations.fromHours(1));
3636
}
3737

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

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

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

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

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

7378
// Using the new Builder
74-
GcRule actual = GcRuleBuilder.union()
75-
.add(GcRuleBuilder.maxVersions(10))
76-
.add(GcRuleBuilder.maxAge(Duration.ofDays(5)))
77-
.build();
79+
GcRule actual =
80+
GcRuleBuilder.union()
81+
.add(GcRuleBuilder.maxVersions(10))
82+
.add(GcRuleBuilder.maxAge(Duration.ofDays(5)))
83+
.build();
7884

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

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

0 commit comments

Comments
 (0)