Package com.apple.foundationdb
Class Range
- java.lang.Object
-
- com.apple.foundationdb.Range
-
public class Range extends java.lang.Object
A simple description of an exact range of keyspace, specified by a begin and end key. As with all FoundationDB APIs,begin
is inclusive,end
exclusive.
-
-
Constructor Summary
Constructors Constructor Description Range(byte[] begin, byte[] end)
Construct a newRange
with an inclusive begin key and an exclusive end key.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Returnstrue
if the givenObject
is aRange
object that refers to the same key range within the keyspace.int
hashCode()
static Range
startsWith(byte[] prefix)
Returns aRange
that describes all possible keys that are prefixed with a specified key.java.lang.String
toString()
Returns a human-readableString
representation of thisRange
.
-
-
-
Method Detail
-
startsWith
public static Range startsWith(byte[] prefix)
Returns aRange
that describes all possible keys that are prefixed with a specified key. Use the result of this call as an input toReadTransaction.getRange(Range)
to replicate the now-removed callTransaction.getRangeStartsWith(k)
.- Parameters:
prefix
- the key prefixing the range, must not benull
- Returns:
- the range of keys starting with
prefix
-
equals
public boolean equals(java.lang.Object o)
Returnstrue
if the givenObject
is aRange
object that refers to the same key range within the keyspace. This will be true if the given range has the samebegin
andend
key. This will returnfalse
if the givenObject
is not aRange
instance.- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- theObject
to check for equality- Returns:
- whether the given
Object
matches thisRange
-
hashCode
public int hashCode()
-
-