docs: public static TreeRuleType stringToType(final String type) {
      if (type == null || type.isEmpty()) {
        throw new IllegalArgumentException("Rule type was empty");
      } else if (type.toLowerCase().equals("metric")) {
        return TreeRuleType.METRIC;
      } else if (type.toLowerCase().equals("metric_custom")) {
        return TreeRuleType.METRIC_CUSTOM;
      } else if (type.toLowerCase().equals("tagk")) {
        return TreeRuleType.TAGK;
      } else if (type.toLowerCase().equals("tagk_custom")) {
        return TreeRuleType.TAGK_CUSTOM;
      } else if (type.toLowerCase().equals("tagv_custom")) {
        return TreeRuleType.TAGV_CUSTOM;
      } else {
        throw new IllegalArgumentException("Unrecognized rule type");
      }
    }