@Test public void testGetNumber() { assertEquals(BigDecimal.ZERO, FastMoney.of(0, "CHF").getNumber().numberValue(BigDecimal.class)); assertEquals(new BigDecimal("100034"), FastMoney.of(100034L, "CHF").getNumber().numberValue(BigDecimal.class)); assertEquals(new BigDecimal("0.34738"), FastMoney.of(new BigDecimal("0.34738"), "CHF").getNumber().numberValue(BigDecimal.class)); }
@Override public NumberValue getNumber() { return new DefaultNumberValue(getBigDecimal()); }
FastMoney implements MonetaryAmount, Comparable<MonetaryAmount>, Serializable { @Override public NumberValue getNumber() { return new DefaultNumberValue(getBigDecimal()); } }
FastMoney implements MonetaryAmount, Comparable<MonetaryAmount>, Serializable { @Override public NumberValue getNumber() { return new DefaultNumberValue(getBigDecimal()); } private  FastMoney(Number number, CurrencyUnit currency); private  FastMoney(NumberValue numberValue, CurrencyUnit currency); private  FastMoney(long number, CurrencyUnit currency); }
FastMoney implements MonetaryAmount, Comparable<MonetaryAmount>, Serializable { @Override public NumberValue getNumber() { return new DefaultNumberValue(getBigDecimal()); } private  FastMoney(Number number, CurrencyUnit currency); private  FastMoney(NumberValue numberValue, CurrencyUnit currency); private  FastMoney(long number, CurrencyUnit currency); @Override CurrencyUnit getCurrency(); @Override MonetaryContext getContext(); static FastMoney of(NumberValue numberBinding, CurrencyUnit currency); static FastMoney of(Number number, CurrencyUnit currency); static FastMoney of(Number number, String currencyCode); static FastMoney zero(CurrencyUnit currency); static FastMoney ofMinor(CurrencyUnit currency, long amountMinor); static FastMoney ofMinor(CurrencyUnit currency, long amountMinor, int factionDigits); @Override int compareTo(MonetaryAmount o); @Override int hashCode(); @Override boolean equals(Object obj); @Override FastMoney abs(); @Override FastMoney add(MonetaryAmount amount); @Override FastMoney divide(Number divisor); @Override FastMoney[] divideAndRemainder(Number divisor); @Override FastMoney divideToIntegralValue(Number divisor); @Override FastMoney multiply(Number multiplicand); @Override FastMoney negate(); @Override FastMoney plus(); @Override FastMoney subtract(MonetaryAmount subtrahend); @Override FastMoney remainder(Number divisor); @Override FastMoney scaleByPowerOfTen(int power); @Override boolean isZero(); @Override boolean isPositive(); @Override boolean isPositiveOrZero(); @Override boolean isNegative(); @Override boolean isNegativeOrZero(); int getScale(); int getPrecision(); @Override int signum(); @Override boolean isLessThan(MonetaryAmount amount); boolean isLessThan(Number number); @Override boolean isLessThanOrEqualTo(MonetaryAmount amount); boolean isLessThanOrEqualTo(Number number); @Override boolean isGreaterThan(MonetaryAmount amount); boolean isGreaterThan(Number number); @Override boolean isGreaterThanOrEqualTo(MonetaryAmount amount); boolean isGreaterThanOrEqualTo(Number number); @Override boolean isEqualTo(MonetaryAmount amount); boolean hasSameNumberAs(Number number); @Override NumberValue getNumber(); @Override String toString(); @Override FastMoney with(MonetaryOperator operator); @Override R query(MonetaryQuery<R> query); static FastMoney from(MonetaryAmount amount); static FastMoney parse(CharSequence text); static FastMoney parse(CharSequence text, MonetaryAmountFormat formatter); @Override FastMoney multiply(double multiplicand); @Override FastMoney divide(long divisor); @Override FastMoney divide(double divisor); @Override FastMoney remainder(long divisor); @Override FastMoney remainder(double divisor); @Override FastMoney[] divideAndRemainder(long divisor); @Override FastMoney[] divideAndRemainder(double divisor); @Override FastMoney stripTrailingZeros(); @Override FastMoney multiply(long multiplicand); @Override FastMoney divideToIntegralValue(long divisor); @Override FastMoney divideToIntegralValue(double divisor); @Override MonetaryAmountFactory<FastMoney> getFactory(); }
FastMoney implements MonetaryAmount, Comparable<MonetaryAmount>, Serializable { @Override public NumberValue getNumber() { return new DefaultNumberValue(getBigDecimal()); } private  FastMoney(Number number, CurrencyUnit currency); private  FastMoney(NumberValue numberValue, CurrencyUnit currency); private  FastMoney(long number, CurrencyUnit currency); @Override CurrencyUnit getCurrency(); @Override MonetaryContext getContext(); static FastMoney of(NumberValue numberBinding, CurrencyUnit currency); static FastMoney of(Number number, CurrencyUnit currency); static FastMoney of(Number number, String currencyCode); static FastMoney zero(CurrencyUnit currency); static FastMoney ofMinor(CurrencyUnit currency, long amountMinor); static FastMoney ofMinor(CurrencyUnit currency, long amountMinor, int factionDigits); @Override int compareTo(MonetaryAmount o); @Override int hashCode(); @Override boolean equals(Object obj); @Override FastMoney abs(); @Override FastMoney add(MonetaryAmount amount); @Override FastMoney divide(Number divisor); @Override FastMoney[] divideAndRemainder(Number divisor); @Override FastMoney divideToIntegralValue(Number divisor); @Override FastMoney multiply(Number multiplicand); @Override FastMoney negate(); @Override FastMoney plus(); @Override FastMoney subtract(MonetaryAmount subtrahend); @Override FastMoney remainder(Number divisor); @Override FastMoney scaleByPowerOfTen(int power); @Override boolean isZero(); @Override boolean isPositive(); @Override boolean isPositiveOrZero(); @Override boolean isNegative(); @Override boolean isNegativeOrZero(); int getScale(); int getPrecision(); @Override int signum(); @Override boolean isLessThan(MonetaryAmount amount); boolean isLessThan(Number number); @Override boolean isLessThanOrEqualTo(MonetaryAmount amount); boolean isLessThanOrEqualTo(Number number); @Override boolean isGreaterThan(MonetaryAmount amount); boolean isGreaterThan(Number number); @Override boolean isGreaterThanOrEqualTo(MonetaryAmount amount); boolean isGreaterThanOrEqualTo(Number number); @Override boolean isEqualTo(MonetaryAmount amount); boolean hasSameNumberAs(Number number); @Override NumberValue getNumber(); @Override String toString(); @Override FastMoney with(MonetaryOperator operator); @Override R query(MonetaryQuery<R> query); static FastMoney from(MonetaryAmount amount); static FastMoney parse(CharSequence text); static FastMoney parse(CharSequence text, MonetaryAmountFormat formatter); @Override FastMoney multiply(double multiplicand); @Override FastMoney divide(long divisor); @Override FastMoney divide(double divisor); @Override FastMoney remainder(long divisor); @Override FastMoney remainder(double divisor); @Override FastMoney[] divideAndRemainder(long divisor); @Override FastMoney[] divideAndRemainder(double divisor); @Override FastMoney stripTrailingZeros(); @Override FastMoney multiply(long multiplicand); @Override FastMoney divideToIntegralValue(long divisor); @Override FastMoney divideToIntegralValue(double divisor); @Override MonetaryAmountFactory<FastMoney> getFactory(); static final FastMoney MAX_VALUE; static final FastMoney MIN_VALUE; }