public static ByteArrayComparable createComparator(byte[] comparator) {
    if (comparator == null) throw new IllegalArgumentException("Incorrect Comparator");
    byte[][] parsedComparator = ParseFilter.parseComparator(comparator);
    byte[] comparatorType = parsedComparator[0];
    byte[] comparatorValue = parsedComparator[1];

    if (Bytes.equals(comparatorType, ParseConstants.binaryType))
      return new BinaryComparator(comparatorValue);
    else if (Bytes.equals(comparatorType, ParseConstants.binaryPrefixType))
      return new BinaryPrefixComparator(comparatorValue);
    else if (Bytes.equals(comparatorType, ParseConstants.regexStringType))
      return new RegexStringComparator(new String(comparatorValue, StandardCharsets.UTF_8));
    else if (Bytes.equals(comparatorType, ParseConstants.regexStringNoCaseType))
      return new RegexStringComparator(new String(comparatorValue, StandardCharsets.UTF_8),
        Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
    else if (Bytes.equals(comparatorType, ParseConstants.substringType))
      return new SubstringComparator(new String(comparatorValue, StandardCharsets.UTF_8));
    else throw new IllegalArgumentException("Incorrect comparatorType");
  }
Parses a comparator of the form comparatorType:comparatorValue form and returns a comparator
<p>
@param comparator the comparator in the form comparatorType:comparatorValue
@return the parsed comparator
hbase-client/src/main/java/org/apache/hadoop/hbase/filter/ParseFilter.java