Class ByteArrayComparable

java.lang.Object
org.apache.hadoop.hbase.filter.ByteArrayComparable
All Implemented Interfaces:
Comparable<byte[]>
Direct Known Subclasses:
BigDecimalComparator, BinaryComparator, BinaryComponentComparator, BinaryPrefixComparator, BitComparator, LongComparator, NullComparator, RegexStringComparator, SubstringComparator

@Public public abstract class ByteArrayComparable extends Object implements Comparable<byte[]>
Base class for byte array comparators
  • Field Details

  • Constructor Details

    • ByteArrayComparable

      public ByteArrayComparable(byte[] value)
      Constructor.
      Parameters:
      value - the value to compare against
  • Method Details

    • getValue

      public byte[] getValue()
    • toByteArray

      public abstract byte[] toByteArray()
      Returns The comparator serialized using pb
    • parseFrom

      public static ByteArrayComparable parseFrom(byte[] pbBytes) throws DeserializationException
      Parse a serialized representation of ByteArrayComparable
      Parameters:
      pbBytes - A pb serialized ByteArrayComparable instance
      Returns:
      An instance of ByteArrayComparable made from bytes
      Throws:
      DeserializationException
      See Also:
    • areSerializedFieldsEqual

      Return true if and only if the fields of the comparator that are serialized are equal to the corresponding fields in other.
    • compareTo

      public int compareTo(byte[] value)
      Specified by:
      compareTo in interface Comparable<byte[]>
    • compareTo

      public abstract int compareTo(byte[] value, int offset, int length)
      Special compareTo method for subclasses, to avoid copying byte[] unnecessarily.
      Parameters:
      value - byte[] to compare
      offset - offset into value
      length - number of bytes to compare
      Returns:
      a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
    • compareTo

      public int compareTo(ByteBuffer value, int offset, int length)
      Special compareTo method for subclasses, to avoid copying bytes unnecessarily.
      Parameters:
      value - bytes to compare within a ByteBuffer
      offset - offset into value
      length - number of bytes to compare
      Returns:
      a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.