@Test(expectedExceptions = ArithmeticException.class) public void testCreatingFromDoubleNan(){ RoundedMoney.of(Double.NaN, "XXX"); }
public static RoundedMoney of(BigDecimal number, CurrencyUnit currency) { return new RoundedMoney(number, currency, Monetary.getDefaultRounding()); }
RoundedMoney implements MonetaryAmount, Comparable<MonetaryAmount>, Serializable { public static RoundedMoney of(BigDecimal number, CurrencyUnit currency) { return new RoundedMoney(number, currency, Monetary.getDefaultRounding()); } }
RoundedMoney implements MonetaryAmount, Comparable<MonetaryAmount>, Serializable { public static RoundedMoney of(BigDecimal number, CurrencyUnit currency) { return new RoundedMoney(number, currency, Monetary.getDefaultRounding()); } RoundedMoney(Number number, CurrencyUnit currency, MonetaryOperator rounding); @Deprecated  RoundedMoney(Number number, CurrencyUnit currency, MathContext mathContext); @Deprecated  RoundedMoney(Number number, CurrencyUnit currency, MonetaryContext context, MonetaryOperator rounding); }
RoundedMoney implements MonetaryAmount, Comparable<MonetaryAmount>, Serializable { public static RoundedMoney of(BigDecimal number, CurrencyUnit currency) { return new RoundedMoney(number, currency, Monetary.getDefaultRounding()); } RoundedMoney(Number number, CurrencyUnit currency, MonetaryOperator rounding); @Deprecated  RoundedMoney(Number number, CurrencyUnit currency, MathContext mathContext); @Deprecated  RoundedMoney(Number number, CurrencyUnit currency, MonetaryContext context, MonetaryOperator rounding); static RoundedMoney of(BigDecimal number, CurrencyUnit currency); static RoundedMoney of(BigDecimal number, CurrencyUnit currency, MonetaryOperator rounding); static RoundedMoney of(BigDecimal number, CurrencyUnit currency, MathContext mathContext); @Deprecated static RoundedMoney of(Number number, CurrencyUnit currency); static RoundedMoney of(Number number, CurrencyUnit currency, MonetaryOperator rounding); static RoundedMoney of(Number number, CurrencyUnit currency, MonetaryContext monetaryContext); @Deprecated static RoundedMoney of(CurrencyUnit currency, Number number, MonetaryContext monetaryContext,
                                  MonetaryOperator rounding); @Deprecated static RoundedMoney of(Number number, String currencyCode); static RoundedMoney of(Number number, String currencyCode, MonetaryOperator rounding); @Deprecated static RoundedMoney of(Number number, String currencyCode, MonetaryContext monetaryContext); static RoundedMoney of(String currencyCode, Number number, MonetaryContext monetaryContext,
                                  MonetaryOperator rounding); static RoundedMoney zero(CurrencyUnit currency); static RoundedMoney ofMinor(CurrencyUnit currency, long amountMinor); static RoundedMoney ofMinor(CurrencyUnit currency, long amountMinor, int factionDigits); @Override CurrencyUnit getCurrency(); @Override MonetaryContext getContext(); @Override RoundedMoney abs(); @Override RoundedMoney add(MonetaryAmount amount); @Override RoundedMoney divide(Number divisor); @Override RoundedMoney[] divideAndRemainder(Number divisor); @Override RoundedMoney divideToIntegralValue(Number divisor); @Override RoundedMoney multiply(Number multiplicand); @Override RoundedMoney negate(); @Override RoundedMoney plus(); @Override RoundedMoney subtract(MonetaryAmount amount); RoundedMoney pow(int n); RoundedMoney ulp(); @Override RoundedMoney remainder(Number divisor); @Override RoundedMoney scaleByPowerOfTen(int power); @Override boolean isZero(); @Override boolean isPositive(); @Override boolean isPositiveOrZero(); @Override boolean isNegative(); @Override boolean isNegativeOrZero(); RoundedMoney with(Number amount); RoundedMoney with(CurrencyUnit currency); RoundedMoney with(CurrencyUnit currency, Number amount); int getScale(); int getPrecision(); @Override int signum(); @Override boolean isLessThan(MonetaryAmount amount); @Override boolean isLessThanOrEqualTo(MonetaryAmount amount); @Override boolean isGreaterThan(MonetaryAmount amount); @Override boolean isGreaterThanOrEqualTo(MonetaryAmount amount); @Override boolean isEqualTo(MonetaryAmount amount); boolean isNotEqualTo(MonetaryAmount amount); @Override RoundedMoney with(MonetaryOperator operator); static RoundedMoney from(MonetaryAmount amt); static RoundedMoney parse(CharSequence text); static RoundedMoney parse(CharSequence text, MonetaryAmountFormat formatter); @Override T query(MonetaryQuery<T> query); @Deprecated @SuppressWarnings("unchecked") T asType(Class<T> type); @Deprecated T asType(Class<T> type, MonetaryOperator adjuster); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(MonetaryAmount o); @Override NumberValue getNumber(); BigDecimal asNumberStripped(); @Override RoundedMoney multiply(long multiplicand); @Override RoundedMoney multiply(double multiplicand); @Override RoundedMoney divide(long divisor); @Override RoundedMoney divide(double divisor); @Override RoundedMoney remainder(long divisor); @Override RoundedMoney remainder(double divisor); @Override RoundedMoney[] divideAndRemainder(long divisor); @Override RoundedMoney[] divideAndRemainder(double divisor); @Override RoundedMoney stripTrailingZeros(); @Override RoundedMoney divideToIntegralValue(long divisor); @Override RoundedMoney divideToIntegralValue(double divisor); @Override MonetaryAmountFactory<RoundedMoney> getFactory(); }
RoundedMoney implements MonetaryAmount, Comparable<MonetaryAmount>, Serializable { public static RoundedMoney of(BigDecimal number, CurrencyUnit currency) { return new RoundedMoney(number, currency, Monetary.getDefaultRounding()); } RoundedMoney(Number number, CurrencyUnit currency, MonetaryOperator rounding); @Deprecated  RoundedMoney(Number number, CurrencyUnit currency, MathContext mathContext); @Deprecated  RoundedMoney(Number number, CurrencyUnit currency, MonetaryContext context, MonetaryOperator rounding); static RoundedMoney of(BigDecimal number, CurrencyUnit currency); static RoundedMoney of(BigDecimal number, CurrencyUnit currency, MonetaryOperator rounding); static RoundedMoney of(BigDecimal number, CurrencyUnit currency, MathContext mathContext); @Deprecated static RoundedMoney of(Number number, CurrencyUnit currency); static RoundedMoney of(Number number, CurrencyUnit currency, MonetaryOperator rounding); static RoundedMoney of(Number number, CurrencyUnit currency, MonetaryContext monetaryContext); @Deprecated static RoundedMoney of(CurrencyUnit currency, Number number, MonetaryContext monetaryContext,
                                  MonetaryOperator rounding); @Deprecated static RoundedMoney of(Number number, String currencyCode); static RoundedMoney of(Number number, String currencyCode, MonetaryOperator rounding); @Deprecated static RoundedMoney of(Number number, String currencyCode, MonetaryContext monetaryContext); static RoundedMoney of(String currencyCode, Number number, MonetaryContext monetaryContext,
                                  MonetaryOperator rounding); static RoundedMoney zero(CurrencyUnit currency); static RoundedMoney ofMinor(CurrencyUnit currency, long amountMinor); static RoundedMoney ofMinor(CurrencyUnit currency, long amountMinor, int factionDigits); @Override CurrencyUnit getCurrency(); @Override MonetaryContext getContext(); @Override RoundedMoney abs(); @Override RoundedMoney add(MonetaryAmount amount); @Override RoundedMoney divide(Number divisor); @Override RoundedMoney[] divideAndRemainder(Number divisor); @Override RoundedMoney divideToIntegralValue(Number divisor); @Override RoundedMoney multiply(Number multiplicand); @Override RoundedMoney negate(); @Override RoundedMoney plus(); @Override RoundedMoney subtract(MonetaryAmount amount); RoundedMoney pow(int n); RoundedMoney ulp(); @Override RoundedMoney remainder(Number divisor); @Override RoundedMoney scaleByPowerOfTen(int power); @Override boolean isZero(); @Override boolean isPositive(); @Override boolean isPositiveOrZero(); @Override boolean isNegative(); @Override boolean isNegativeOrZero(); RoundedMoney with(Number amount); RoundedMoney with(CurrencyUnit currency); RoundedMoney with(CurrencyUnit currency, Number amount); int getScale(); int getPrecision(); @Override int signum(); @Override boolean isLessThan(MonetaryAmount amount); @Override boolean isLessThanOrEqualTo(MonetaryAmount amount); @Override boolean isGreaterThan(MonetaryAmount amount); @Override boolean isGreaterThanOrEqualTo(MonetaryAmount amount); @Override boolean isEqualTo(MonetaryAmount amount); boolean isNotEqualTo(MonetaryAmount amount); @Override RoundedMoney with(MonetaryOperator operator); static RoundedMoney from(MonetaryAmount amt); static RoundedMoney parse(CharSequence text); static RoundedMoney parse(CharSequence text, MonetaryAmountFormat formatter); @Override T query(MonetaryQuery<T> query); @Deprecated @SuppressWarnings("unchecked") T asType(Class<T> type); @Deprecated T asType(Class<T> type, MonetaryOperator adjuster); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(MonetaryAmount o); @Override NumberValue getNumber(); BigDecimal asNumberStripped(); @Override RoundedMoney multiply(long multiplicand); @Override RoundedMoney multiply(double multiplicand); @Override RoundedMoney divide(long divisor); @Override RoundedMoney divide(double divisor); @Override RoundedMoney remainder(long divisor); @Override RoundedMoney remainder(double divisor); @Override RoundedMoney[] divideAndRemainder(long divisor); @Override RoundedMoney[] divideAndRemainder(double divisor); @Override RoundedMoney stripTrailingZeros(); @Override RoundedMoney divideToIntegralValue(long divisor); @Override RoundedMoney divideToIntegralValue(double divisor); @Override MonetaryAmountFactory<RoundedMoney> getFactory(); static final MonetaryContext DEFAULT_MONETARY_CONTEXT; }