@Test(expectedExceptions = NullPointerException.class) public void shouldReturnErrorParseWhenMonetaryAmountIsNull() { format.parse(null); }
@Override public MonetaryAmount parse(CharSequence text) throws MonetaryParseException { requireNonNull(text); try { Number number = decimalFormat.parse(text.toString()); return producer.create(currencyUnit, number); } catch (Exception exception) { throw new MonetaryParseException(exception.getMessage(), text, 0); } }
MonetaryAmountDecimalFormat implements MonetaryAmountFormat { @Override public MonetaryAmount parse(CharSequence text) throws MonetaryParseException { requireNonNull(text); try { Number number = decimalFormat.parse(text.toString()); return producer.create(currencyUnit, number); } catch (Exception exception) { throw new MonetaryParseException(exception.getMessage(), text, 0); } } }
MonetaryAmountDecimalFormat implements MonetaryAmountFormat { @Override public MonetaryAmount parse(CharSequence text) throws MonetaryParseException { requireNonNull(text); try { Number number = decimalFormat.parse(text.toString()); return producer.create(currencyUnit, number); } catch (Exception exception) { throw new MonetaryParseException(exception.getMessage(), text, 0); } } MonetaryAmountDecimalFormat(DecimalFormat decimalFormat, MonetaryAmountProducer producer, CurrencyUnit currencyUnit); }
MonetaryAmountDecimalFormat implements MonetaryAmountFormat { @Override public MonetaryAmount parse(CharSequence text) throws MonetaryParseException { requireNonNull(text); try { Number number = decimalFormat.parse(text.toString()); return producer.create(currencyUnit, number); } catch (Exception exception) { throw new MonetaryParseException(exception.getMessage(), text, 0); } } 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 MonetaryAmount parse(CharSequence text) throws MonetaryParseException { requireNonNull(text); try { Number number = decimalFormat.parse(text.toString()); return producer.create(currencyUnit, number); } catch (Exception exception) { throw new MonetaryParseException(exception.getMessage(), text, 0); } } 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();  }