@InterfaceAudience.Public public class SubstringComparator extends ByteArrayComparable
Only EQUAL or NOT_EQUAL tests are valid with this comparator.
For example:
SingleColumnValueFilter scvf = new SingleColumnValueFilter("col", CompareOp.EQUAL, new SubstringComparator("substr"));
Modifier and Type | Field and Description |
---|---|
private String |
substr |
value
Constructor and Description |
---|
SubstringComparator(String substr)
Constructor
|
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
areSerializedFieldsEqual(ByteArrayComparable other)
Returns true if and only if the fields of the comparator that are serialized are equal to the
corresponding fields in other.
|
int |
compareTo(byte[] value,
int offset,
int length)
Special compareTo method for subclasses, to avoid copying byte[] unnecessarily.
|
byte[] |
getValue() |
static SubstringComparator |
parseFrom(byte[] pbBytes)
Parse a serialized representation of
SubstringComparator |
byte[] |
toByteArray()
Returns The comparator serialized using pb
|
compareTo, compareTo
public SubstringComparator(String substr)
substr
- the substringpublic byte[] getValue()
getValue
in class ByteArrayComparable
public int compareTo(byte[] value, int offset, int length)
ByteArrayComparable
compareTo
in class ByteArrayComparable
value
- byte[] to compareoffset
- offset into valuelength
- number of bytes to comparepublic byte[] toByteArray()
toByteArray
in class ByteArrayComparable
public static SubstringComparator parseFrom(byte[] pbBytes) throws DeserializationException
SubstringComparator
pbBytes
- A pb serialized SubstringComparator
instanceSubstringComparator
made from bytes
DeserializationException
- if an error occurredtoByteArray()
boolean areSerializedFieldsEqual(ByteArrayComparable other)
areSerializedFieldsEqual
in class ByteArrayComparable
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.