public class Money extends java.lang.Object implements java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<Money>, java.io.Externalizable
| Constructor and Description |
|---|
Money() |
Money(java.math.BigDecimal amount) |
Money(java.math.BigDecimal amount,
BroadleafCurrency blCurrency) |
Money(java.math.BigDecimal amount,
BroadleafCurrency blCurrency,
int scale) |
Money(java.math.BigDecimal amount,
java.util.Currency currency) |
Money(java.math.BigDecimal amount,
java.util.Currency currency,
int scale) |
Money(java.math.BigDecimal amount,
java.lang.String currencyCode) |
Money(BroadleafCurrency blCurrency) |
Money(java.util.Currency currency) |
Money(double amount) |
Money(double amount,
java.util.Currency currency) |
Money(double amount,
java.lang.String currencyCode) |
Money(int amount) |
Money(int amount,
java.util.Currency currency) |
Money(int amount,
java.lang.String currencyCode) |
Money(long amount) |
Money(long amount,
java.util.Currency currency) |
Money(long amount,
java.lang.String currencyCode) |
Money(java.lang.String amount) |
Money(java.lang.String amount,
java.util.Currency currency) |
Money(java.lang.String amount,
java.lang.String currencyCode) |
| Modifier and Type | Method and Description |
|---|---|
Money |
abs() |
static Money |
abs(Money money) |
Money |
add(Money other) |
java.lang.Object |
clone() |
int |
compareTo(java.math.BigDecimal value) |
int |
compareTo(Money other) |
static java.util.Currency |
defaultCurrency()
Attempts to load a default currency by using the default locale.
|
Money |
divide(java.math.BigDecimal divisor) |
Money |
divide(java.math.BigDecimal divisor,
java.math.RoundingMode roundingMode) |
Money |
divide(double amount) |
Money |
divide(double amount,
java.math.RoundingMode roundingMode) |
Money |
divide(int amount) |
Money |
divide(int amount,
java.math.RoundingMode roundingMode) |
double |
doubleValue() |
boolean |
equals(java.lang.Object o) |
java.math.BigDecimal |
getAmount() |
java.util.Currency |
getCurrency() |
protected static java.lang.String |
getCurrencyCode(BroadleafCurrency blCurrency) |
boolean |
greaterThan(java.math.BigDecimal value) |
boolean |
greaterThan(Money other) |
boolean |
greaterThanOrEqual(java.math.BigDecimal value) |
boolean |
greaterThanOrEqual(Money other) |
int |
hashCode() |
boolean |
isZero() |
boolean |
lessThan(java.math.BigDecimal value) |
boolean |
lessThan(Money other) |
boolean |
lessThanOrEqual(java.math.BigDecimal value) |
boolean |
lessThanOrEqual(Money other) |
Money |
max(Money other) |
static Money |
max(Money left,
Money right) |
Money |
min(Money other) |
static Money |
min(Money left,
Money right) |
Money |
multiply(java.math.BigDecimal multiplier) |
Money |
multiply(double amount) |
Money |
multiply(int amount) |
Money |
negate() |
void |
readExternal(java.io.ObjectInput in) |
java.lang.String |
stringValue() |
Money |
subtract(Money other) |
static java.math.BigDecimal |
toAmount(Money money) |
static java.util.Currency |
toCurrency(Money money) |
java.lang.String |
toString() |
void |
writeExternal(java.io.ObjectOutput out) |
Money |
zero() |
static Money |
zero(java.util.Currency currency) |
static Money |
zero(java.lang.String currencyCode) |
public static final Money ZERO
public Money(java.util.Currency currency)
public Money(BroadleafCurrency blCurrency)
public Money(java.math.BigDecimal amount,
BroadleafCurrency blCurrency)
public Money(java.math.BigDecimal amount,
BroadleafCurrency blCurrency,
int scale)
public Money()
public Money(java.math.BigDecimal amount)
public Money(double amount)
public Money(int amount)
public Money(long amount)
public Money(java.lang.String amount)
public Money(java.math.BigDecimal amount,
java.lang.String currencyCode)
public Money(double amount,
java.util.Currency currency)
public Money(double amount,
java.lang.String currencyCode)
public Money(int amount,
java.util.Currency currency)
public Money(int amount,
java.lang.String currencyCode)
public Money(long amount,
java.util.Currency currency)
public Money(long amount,
java.lang.String currencyCode)
public Money(java.lang.String amount,
java.util.Currency currency)
public Money(java.lang.String amount,
java.lang.String currencyCode)
public Money(java.math.BigDecimal amount,
java.util.Currency currency)
public Money(java.math.BigDecimal amount,
java.util.Currency currency,
int scale)
protected static java.lang.String getCurrencyCode(BroadleafCurrency blCurrency)
public java.math.BigDecimal getAmount()
public java.util.Currency getCurrency()
public Money multiply(double amount)
public Money multiply(int amount)
public Money multiply(java.math.BigDecimal multiplier)
public Money divide(double amount)
public Money divide(double amount, java.math.RoundingMode roundingMode)
public Money divide(int amount)
public Money divide(int amount, java.math.RoundingMode roundingMode)
public Money divide(java.math.BigDecimal divisor)
public Money divide(java.math.BigDecimal divisor, java.math.RoundingMode roundingMode)
public Money abs()
public Money negate()
public boolean isZero()
public Money zero()
public boolean lessThan(Money other)
public boolean lessThan(java.math.BigDecimal value)
public boolean lessThanOrEqual(Money other)
public boolean lessThanOrEqual(java.math.BigDecimal value)
public boolean greaterThan(Money other)
public boolean greaterThan(java.math.BigDecimal value)
public boolean greaterThanOrEqual(Money other)
public boolean greaterThanOrEqual(java.math.BigDecimal value)
public int compareTo(Money other)
compareTo in interface java.lang.Comparable<Money>public int compareTo(java.math.BigDecimal value)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.Object clone()
clone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic double doubleValue()
public java.lang.String stringValue()
public static Money zero(java.lang.String currencyCode)
public static Money zero(java.util.Currency currency)
public static java.math.BigDecimal toAmount(Money money)
public static java.util.Currency toCurrency(Money money)
public static java.util.Currency defaultCurrency()
Currency.getInstance(Locale) uses the country component of the locale to resolve the currency. In some instances, the locale may not have a country component, in which case the default currency can be controlled with a
system property.public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOExceptionCopyright © 2018. All Rights Reserved.