@Test public void fetchCurrencyValue() { SolrDocument doc = new SolrDocument(); doc.addField("maximumMoneyAmount", "12300.45,PLN"); BigDecimal actual = fieldFetcher.fetchCurrencyValue(doc, JudgmentIndexField.MAXIMUM_MONEY_AMOUNT); assertEquals(new BigDecimal("12300.45"), actual); }
public BigDecimal fetchCurrencyValue(SolrDocument doc, F field) { Object value = doc.getFirstValue(field.getFieldName()); if (value == null) { return null; } String currencyValueString = (String) value; String valueWithoutCurrency = currencyValueString.split(",")[0]; return new BigDecimal(valueWithoutCurrency); }
SolrFieldFetcher { public BigDecimal fetchCurrencyValue(SolrDocument doc, F field) { Object value = doc.getFirstValue(field.getFieldName()); if (value == null) { return null; } String currencyValueString = (String) value; String valueWithoutCurrency = currencyValueString.split(",")[0]; return new BigDecimal(valueWithoutCurrency); } }
SolrFieldFetcher { public BigDecimal fetchCurrencyValue(SolrDocument doc, F field) { Object value = doc.getFirstValue(field.getFieldName()); if (value == null) { return null; } String currencyValueString = (String) value; String valueWithoutCurrency = currencyValueString.split(",")[0]; return new BigDecimal(valueWithoutCurrency); }  }
SolrFieldFetcher { public BigDecimal fetchCurrencyValue(SolrDocument doc, F field) { Object value = doc.getFirstValue(field.getFieldName()); if (value == null) { return null; } String currencyValueString = (String) value; String valueWithoutCurrency = currencyValueString.split(",")[0]; return new BigDecimal(valueWithoutCurrency); }  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 BigDecimal fetchCurrencyValue(SolrDocument doc, F field) { Object value = doc.getFirstValue(field.getFieldName()); if (value == null) { return null; } String currencyValueString = (String) value; String valueWithoutCurrency = currencyValueString.split(",")[0]; return new BigDecimal(valueWithoutCurrency); }  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);  }