code: @Override
    public Filter adapt(FilterAdapterContext context,
        org.apache.hadoop.hbase.filter.RowFilter filter) throws IOException {
      CompareOp compareOp = filter.getOperator();
      if (compareOp != CompareFilter.CompareOp.EQUAL) {
        throw new IllegalStateException(String.format("Cannot adapt operator %s",
          compareOp == null ? null : compareOp.getClass().getCanonicalName()));
      }
      ByteArrayComparable comparator = filter.getComparator();
      ByteString regexValue;
      if (comparator == null) {
        throw new IllegalStateException("Comparator cannot be null"); 
      } else if (comparator instanceof RegexStringComparator) {
        regexValue = ByteString.copyFrom(comparator.getValue());
      } else if (comparator instanceof BinaryComparator) {
        regexValue =
            ReaderExpressionHelper.quoteRegularExpression(comparator.getValue());
      } else {
        throw new IllegalStateException(String.format("Cannot adapt comparator %s", comparator
            .getClass().getCanonicalName()));
      }
      return FILTERS.key().regex(regexValue);
    }
docs: {@inheritDoc}