Class GcRuleBuilder (2.72.0)

public final class GcRuleBuilder

Factory for creating safe GcRule protos.

Use this class to construct GcRule instances instead of the raw proto builder (GcRule#newBuilder()) to avoid common pitfalls with "oneof" fields (e.g. accidentally overwriting max age with max versions).

Inheritance

java.lang.Object > GcRuleBuilder

Static Methods

intersection()

public static IntersectionRuleBuilder intersection()

Starts building an Intersection (AND) rule.

Returns
Type Description
IntersectionRuleBuilder

A new builder for an intersection rule.

maxAge(Duration age)

public static GcRule maxAge(Duration age)

Creates a Max Age rule.

Parameter
Name Description
age Duration

The maximum age of the cell.

Returns
Type Description
com.google.bigtable.admin.v2.GcRule

The constructed GcRule proto.

maxVersions(int versions)

public static GcRule maxVersions(int versions)

Creates a Max Versions rule.

Parameter
Name Description
versions int

The maximum number of versions.

Returns
Type Description
com.google.bigtable.admin.v2.GcRule

The constructed GcRule proto.

union()

public static UnionRuleBuilder union()

Starts building a Union (OR) rule.

Returns
Type Description
UnionRuleBuilder

A new builder for a union rule.