@InternalExtensionOnly public abstract class Range<T,R extends Range<T,R>> extends Object implements Serializable
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();
Modifier and Type | Class and Description |
---|---|
static class |
Range.BoundType |
static class |
Range.ByteStringRange
Concrete Range for ByteStrings
|
static class |
Range.TimestampRange
Concrete Range for timestamps
|
Modifier and Type | Method and Description |
---|---|
R |
endClosed(T end)
Creates a new
Range with the specified inclusive end and the current start. |
R |
endOpen(T end)
Creates a new
Range with the specified exclusive end and the current start. |
R |
endUnbounded()
Creates a new
Range with the current start and an unbounded end. |
T |
getEnd()
Gets the current end value.
|
Range.BoundType |
getEndBound()
Gets the current end
Range.BoundType . |
T |
getStart()
Gets the current start value.
|
Range.BoundType |
getStartBound()
Gets the current start
Range.BoundType . |
R |
of(T startClosed,
T endOpen)
Creates a new
Range with the specified inclusive start and the specified exclusive end. |
R |
startClosed(T start)
Creates a new
Range with the specified inclusive start and the current end. |
R |
startOpen(T start)
Creates a new
Range with the specified exclusive start and the current end. |
R |
startUnbounded()
Creates a new
Range with an unbounded start and the current end. |
public R of(@Nonnull T startClosed, @Nonnull T endOpen)
Range
with the specified inclusive start and the specified exclusive end.public R startUnbounded()
Range
with an unbounded start and the current end.public R startOpen(@Nonnull T start)
Range
with the specified exclusive start and the current end.public R startClosed(@Nonnull T start)
Range
with the specified inclusive start and the current end.public R endUnbounded()
Range
with the current start and an unbounded end.public R endOpen(@Nonnull T end)
Range
with the specified exclusive end and the current start.public R endClosed(@Nonnull T end)
Range
with the specified inclusive end and the current start.public Range.BoundType getStartBound()
Range.BoundType
.public T getStart()
IllegalStateException
- If the current getStartBound()
is Range.BoundType.UNBOUNDED
.public Range.BoundType getEndBound()
Range.BoundType
.public T getEnd()
IllegalStateException
- If the current getEndBound()
is Range.BoundType.UNBOUNDED
.Copyright © 2019 Google LLC. All rights reserved.