code: @Override
    public Filter adapt(FilterAdapterContext context, QualifierFilter filter)
        throws IOException {
      if (filter.getComparator() instanceof RegexStringComparator) {
        return adaptRegexStringComparator(
            filter.getOperator(), (RegexStringComparator) filter.getComparator());
      } else if (filter.getComparator() instanceof BinaryComparator) {
        return adaptBinaryComparator(
            context, filter.getOperator(), (BinaryComparator) filter.getComparator());
      }
      throw new IllegalStateException(
          String.format(
              "Cannot adapt comparator %s",
              filter.getComparator().getClass().getCanonicalName()));
    }
docs: {@inheritDoc}