@Test public void transformToRangeCriterion() { String actual = criterionTransformer.transformToRangeCriterion(JudgmentIndexField.KEYWORD, "aa", "ba"); assertEquals("+keyword:[aa TO ba]", actual); }
public String transformToRangeCriterion(F field, String from, String to) { if (StringUtils.isBlank(from) && StringUtils.isBlank(to)) { return StringUtils.EMPTY; } String parsedFrom = (StringUtils.isBlank(from)) ? "*" : StringUtils.trim(from); String parsedTo = (StringUtils.isBlank(to)) ? "*" : StringUtils.trim(to); return "+" + field.getFieldName() + ":[" + parsedFrom + " TO " + parsedTo + "]"; }
SolrCriterionTransformer { public String transformToRangeCriterion(F field, String from, String to) { if (StringUtils.isBlank(from) && StringUtils.isBlank(to)) { return StringUtils.EMPTY; } String parsedFrom = (StringUtils.isBlank(from)) ? "*" : StringUtils.trim(from); String parsedTo = (StringUtils.isBlank(to)) ? "*" : StringUtils.trim(to); return "+" + field.getFieldName() + ":[" + parsedFrom + " TO " + parsedTo + "]"; } }
SolrCriterionTransformer { public String transformToRangeCriterion(F field, String from, String to) { if (StringUtils.isBlank(from) && StringUtils.isBlank(to)) { return StringUtils.EMPTY; } String parsedFrom = (StringUtils.isBlank(from)) ? "*" : StringUtils.trim(from); String parsedTo = (StringUtils.isBlank(to)) ? "*" : StringUtils.trim(to); return "+" + field.getFieldName() + ":[" + parsedFrom + " TO " + parsedTo + "]"; }  }
SolrCriterionTransformer { public String transformToRangeCriterion(F field, String from, String to) { if (StringUtils.isBlank(from) && StringUtils.isBlank(to)) { return StringUtils.EMPTY; } String parsedFrom = (StringUtils.isBlank(from)) ? "*" : StringUtils.trim(from); String parsedTo = (StringUtils.isBlank(to)) ? "*" : StringUtils.trim(to); return "+" + field.getFieldName() + ":[" + parsedFrom + " TO " + parsedTo + "]"; }  String transformToEqualsCriterionWithParsing(F field, String value); String transformToEqualsCriterion(F field, String value); String transformToEqualsCriterion(F field, String value, Operator operator); String transformToEqualsCriterion(F field, Integer value); String transformToEqualsCriterion(F field, Long value); String transformToEqualsCriterion(F field, Enum<?> enumValue); String transformToEqualsCriteria(F field, List<String> values, Operator operator); String transformToEqualsEnumCriteria(F field, List<? extends Enum<?>> values, Operator operator); String transformToDateRangeCriterion(F field, LocalDate from, LocalDate to); String transformToRangeCriterion(F field, String from, String to); String and(String criterion); String join(List<String> criteria); }
SolrCriterionTransformer { public String transformToRangeCriterion(F field, String from, String to) { if (StringUtils.isBlank(from) && StringUtils.isBlank(to)) { return StringUtils.EMPTY; } String parsedFrom = (StringUtils.isBlank(from)) ? "*" : StringUtils.trim(from); String parsedTo = (StringUtils.isBlank(to)) ? "*" : StringUtils.trim(to); return "+" + field.getFieldName() + ":[" + parsedFrom + " TO " + parsedTo + "]"; }  String transformToEqualsCriterionWithParsing(F field, String value); String transformToEqualsCriterion(F field, String value); String transformToEqualsCriterion(F field, String value, Operator operator); String transformToEqualsCriterion(F field, Integer value); String transformToEqualsCriterion(F field, Long value); String transformToEqualsCriterion(F field, Enum<?> enumValue); String transformToEqualsCriteria(F field, List<String> values, Operator operator); String transformToEqualsEnumCriteria(F field, List<? extends Enum<?>> values, Operator operator); String transformToDateRangeCriterion(F field, LocalDate from, LocalDate to); String transformToRangeCriterion(F field, String from, String to); String and(String criterion); String join(List<String> criteria);  }