public class Money extends java.lang.Number implements java.io.Serializable, java.lang.Comparable<Money>
| Constructor and Description |
|---|
Money()
Deprecated.
Use Money.ZERO() instead.
|
Money(java.math.BigDecimal value) |
Money(java.math.BigDecimal value,
java.math.RoundingMode roundingMode) |
Money(double value)
Deprecated.
Use
Money(String) or Money(java.math.BigDecimal) instead in that double value are inherently unsafe. |
Money(double value,
java.math.RoundingMode roundingMode)
Deprecated.
Use
Money(String) or Money(java.math.BigDecimal) instead in that double value are inherently unsafe. |
Money(Money copy) |
Money(java.lang.String value) |
Money(java.lang.String value,
java.math.RoundingMode roundingMode) |
| Modifier and Type | Method and Description |
|---|---|
Money |
add(Money amount) |
int |
compareTo(Money amount) |
Money |
divide(double divisor) |
double |
doubleValue() |
boolean |
equals(java.lang.Object object) |
float |
floatValue() |
Money |
getAbsolute() |
java.math.BigDecimal |
getBigDecimalValue() |
long |
getInternalValue() |
java.lang.String |
getShortForm() |
java.math.BigDecimal |
getWholeNumber() |
boolean |
greaterThan(Money that) |
int |
intValue() |
boolean |
isNegative() |
boolean |
isNonNegative() |
boolean |
isNonPositive() |
boolean |
isNonZero() |
boolean |
isPositive() |
boolean |
isZero() |
boolean |
lessThan(Money that) |
long |
longValue() |
static Money |
MAX_VALUE() |
static Money |
MIN_VALUE() |
Money |
minus(Money amount) |
Money |
multiply(java.math.BigDecimal multiplier) |
Money |
multiply(double multiplier) |
Money |
multiply(long multiplier) |
Money |
negate() |
Money |
plus(Money amount) |
Money |
subtract(Money amount) |
java.lang.String |
toString() |
static Money |
ZERO() |
@Deprecated public Money()
@Deprecated public Money(double value)
Money(String) or Money(java.math.BigDecimal) instead in that double value are inherently unsafe.value - the value to initialize from@Deprecated
public Money(double value,
java.math.RoundingMode roundingMode)
Money(String) or Money(java.math.BigDecimal) instead in that double value are inherently unsafe.value - the value to initialize fromroundingMode - the rounding mode used in the conversion.public Money(java.lang.String value)
public Money(java.lang.String value,
java.math.RoundingMode roundingMode)
public Money(java.math.BigDecimal value)
public Money(java.math.BigDecimal value,
java.math.RoundingMode roundingMode)
public Money(Money copy)
public static Money ZERO()
public static Money MIN_VALUE()
public static Money MAX_VALUE()
public long getInternalValue()
public java.lang.String getShortForm()
public java.lang.String toString()
toString in class java.lang.Objectpublic Money getAbsolute()
public Money multiply(long multiplier)
public Money multiply(double multiplier)
public Money multiply(java.math.BigDecimal multiplier)
public Money divide(double divisor)
public boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic boolean greaterThan(Money that)
public boolean lessThan(Money that)
public boolean isNegative()
public boolean isNonNegative()
public boolean isPositive()
public boolean isNonPositive()
public boolean isZero()
public boolean isNonZero()
public java.math.BigDecimal getWholeNumber()
public java.math.BigDecimal getBigDecimalValue()
public double doubleValue()
doubleValue in class java.lang.Numberpublic int intValue()
intValue in class java.lang.Numberpublic long longValue()
longValue in class java.lang.Numberpublic float floatValue()
floatValue in class java.lang.Numberpublic int compareTo(Money amount)
compareTo in interface java.lang.Comparable<Money>public Money negate()