@Test public void fetchLongValue() { SolrDocument doc = new SolrDocument(); doc.addField("ccCourtId", 123l); Long actual = fieldFetcher.fetchLongValue(doc, JudgmentIndexField.CC_COURT_ID); assertEquals(123l, actual.longValue()); }
public Long fetchLongValue(SolrDocument doc, F field) { Object value = doc.getFirstValue(field.getFieldName()); if (value == null) { return null; } if (!(value instanceof Long)) { throw new RuntimeException(value + " is not Long (field: " + field.getFieldName() + ")"); } return (Long) value; }
SolrFieldFetcher { public Long fetchLongValue(SolrDocument doc, F field) { Object value = doc.getFirstValue(field.getFieldName()); if (value == null) { return null; } if (!(value instanceof Long)) { throw new RuntimeException(value + " is not Long (field: " + field.getFieldName() + ")"); } return (Long) value; } }
SolrFieldFetcher { public Long fetchLongValue(SolrDocument doc, F field) { Object value = doc.getFirstValue(field.getFieldName()); if (value == null) { return null; } if (!(value instanceof Long)) { throw new RuntimeException(value + " is not Long (field: " + field.getFieldName() + ")"); } return (Long) value; }  }
SolrFieldFetcher { public Long fetchLongValue(SolrDocument doc, F field) { Object value = doc.getFirstValue(field.getFieldName()); if (value == null) { return null; } if (!(value instanceof Long)) { throw new RuntimeException(value + " is not Long (field: " + field.getFieldName() + ")"); } return (Long) value; }  String fetchValue(SolrDocument doc, F field); Long fetchLongValue(SolrDocument doc, F field); BigDecimal fetchCurrencyValue(SolrDocument doc, F field); LocalDate fetchDateValue(SolrDocument doc, F field); List<String> fetchValues(SolrDocument doc, F field); List<String> fetchValues(SolrDocument doc, F field, String postfix); List<Pair<String, List<String>>> fetchValuesWithAttributes(SolrDocument doc, F field); List<Pair<String, List<E>>> fetchValuesWithEnumedAttributes(SolrDocument doc, F field, Class<E> allowedAttributes); }
SolrFieldFetcher { public Long fetchLongValue(SolrDocument doc, F field) { Object value = doc.getFirstValue(field.getFieldName()); if (value == null) { return null; } if (!(value instanceof Long)) { throw new RuntimeException(value + " is not Long (field: " + field.getFieldName() + ")"); } return (Long) value; }  String fetchValue(SolrDocument doc, F field); Long fetchLongValue(SolrDocument doc, F field); BigDecimal fetchCurrencyValue(SolrDocument doc, F field); LocalDate fetchDateValue(SolrDocument doc, F field); List<String> fetchValues(SolrDocument doc, F field); List<String> fetchValues(SolrDocument doc, F field, String postfix); List<Pair<String, List<String>>> fetchValuesWithAttributes(SolrDocument doc, F field); List<Pair<String, List<E>>> fetchValuesWithEnumedAttributes(SolrDocument doc, F field, Class<E> allowedAttributes);  }