Class Range<T,R extends Range<T,R>>
- java.lang.Object
-
- com.google.cloud.bigtable.data.v2.models.Range<T,R>
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Filters.QualifierRangeFilter
,Filters.TimestampRangeFilter
,Filters.ValueRangeFilter
,Range.ByteStringRange
,Range.TimestampRange
@InternalExtensionOnly public abstract class Range<T,R extends Range<T,R>> extends Object implements Serializable
Range API.This base class represents the API for all ranges in the Cloud Bigtable client. Please note this mutable type. It's intended to support fluent DSLs.For example:
// A Range that encloses all strings ByteStringRange.unbounded(); // Range that includes all strings including "begin" up until "end" ByteStringRange.unbounded().of("start", "end"); // Create a Bytestring range with an unbounded start and the inclusive end "end" ByteStringRange.unbounded().endClosed("end"); // Ranges are mutable, so take care to clone them to get a new instance ByteStringRange r1 = ByteStringRange.of("a", "z"); ByteStringRange r2 = r1.clone().endUnbounded();
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Range.BoundType
static class
Range.ByteStringRange
Concrete Range for ByteStringsstatic class
Range.TimestampRange
Concrete Range for timestamps
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description R
endClosed(T end)
Creates a newRange
with the specified inclusive end and the current start.R
endOpen(T end)
Creates a newRange
with the specified exclusive end and the current start.R
endUnbounded()
Creates a newRange
with the current start and an unbounded end.T
getEnd()
Gets the current end value.Range.BoundType
getEndBound()
Gets the current endRange.BoundType
.T
getStart()
Gets the current start value.Range.BoundType
getStartBound()
Gets the current startRange.BoundType
.R
of(T startClosed, T endOpen)
Creates a newRange
with the specified inclusive start and the specified exclusive end.R
startClosed(T start)
Creates a newRange
with the specified inclusive start and the current end.R
startOpen(T start)
Creates a newRange
with the specified exclusive start and the current end.R
startUnbounded()
Creates a newRange
with an unbounded start and the current end.
-
-
-
Method Detail
-
of
public R of(@Nonnull T startClosed, @Nonnull T endOpen)
Creates a newRange
with the specified inclusive start and the specified exclusive end.
-
startUnbounded
public R startUnbounded()
Creates a newRange
with an unbounded start and the current end.
-
startOpen
public R startOpen(@Nonnull T start)
Creates a newRange
with the specified exclusive start and the current end.
-
startClosed
public R startClosed(@Nonnull T start)
Creates a newRange
with the specified inclusive start and the current end.
-
endUnbounded
public R endUnbounded()
Creates a newRange
with the current start and an unbounded end.
-
endOpen
public R endOpen(@Nonnull T end)
Creates a newRange
with the specified exclusive end and the current start.
-
endClosed
public R endClosed(@Nonnull T end)
Creates a newRange
with the specified inclusive end and the current start.
-
getStartBound
public Range.BoundType getStartBound()
Gets the current startRange.BoundType
.
-
getStart
public T getStart()
Gets the current start value.- Throws:
IllegalStateException
- If the currentgetStartBound()
isRange.BoundType.UNBOUNDED
.
-
getEndBound
public Range.BoundType getEndBound()
Gets the current endRange.BoundType
.
-
getEnd
public T getEnd()
Gets the current end value.- Throws:
IllegalStateException
- If the currentgetEndBound()
isRange.BoundType.UNBOUNDED
.
-
-