@Test public void shouldQueryFromNullWhenMonetaryAmountIsNull() throws IOException { assertEquals(format.queryFrom(null), "null"); }
@Override public String queryFrom(MonetaryAmount amount) { return Optional .ofNullable(amount) .map(m -> decimalFormat.format(amount.getNumber().numberValue( BigDecimal.class))).orElse("null"); }
MonetaryAmountDecimalFormat implements MonetaryAmountFormat { @Override public String queryFrom(MonetaryAmount amount) { return Optional .ofNullable(amount) .map(m -> decimalFormat.format(amount.getNumber().numberValue( BigDecimal.class))).orElse("null"); } }
MonetaryAmountDecimalFormat implements MonetaryAmountFormat { @Override public String queryFrom(MonetaryAmount amount) { return Optional .ofNullable(amount) .map(m -> decimalFormat.format(amount.getNumber().numberValue( BigDecimal.class))).orElse("null"); } MonetaryAmountDecimalFormat(DecimalFormat decimalFormat, MonetaryAmountProducer producer, CurrencyUnit currencyUnit); }
MonetaryAmountDecimalFormat implements MonetaryAmountFormat { @Override public String queryFrom(MonetaryAmount amount) { return Optional .ofNullable(amount) .map(m -> decimalFormat.format(amount.getNumber().numberValue( BigDecimal.class))).orElse("null"); } MonetaryAmountDecimalFormat(DecimalFormat decimalFormat, MonetaryAmountProducer producer, CurrencyUnit currencyUnit); static MonetaryAmountFormat of(); String toLocalizedPattern(); String toPattern(); @Override AmountFormatContext getContext(); @Override void print(Appendable appendable, MonetaryAmount amount); @Override MonetaryAmount parse(CharSequence text); @Override String queryFrom(MonetaryAmount amount); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
MonetaryAmountDecimalFormat implements MonetaryAmountFormat { @Override public String queryFrom(MonetaryAmount amount) { return Optional .ofNullable(amount) .map(m -> decimalFormat.format(amount.getNumber().numberValue( BigDecimal.class))).orElse("null"); } MonetaryAmountDecimalFormat(DecimalFormat decimalFormat, MonetaryAmountProducer producer, CurrencyUnit currencyUnit); static MonetaryAmountFormat of(); String toLocalizedPattern(); String toPattern(); @Override AmountFormatContext getContext(); @Override void print(Appendable appendable, MonetaryAmount amount); @Override MonetaryAmount parse(CharSequence text); @Override String queryFrom(MonetaryAmount amount); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }