Package com.exedio.cope.pattern
Class Money<C extends Money.Currency>
java.lang.Object
com.exedio.cope.pattern.Money<C>
- All Implemented Interfaces:
Serializable
,Comparable<Money<C>>
public final class Money<C extends Money.Currency>
extends Object
implements Serializable, Comparable<Money<C>>
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionlong
amountStore
(C currency) static <CURRENCY extends Money.Currency>
Money<CURRENCY>[]array
(int size) Deprecated.int
divide
(double other) double
doubleAmount
(Money.Currency currency) double
doubleValue
(Money.Currency currency) Deprecated.UsedoubleAmount(Currency)
insteadboolean
boolean
Deprecated.getAmount
(Money.Currency currency) getGreater
(Money<C> other) Deprecated.Usemax(Money)
insteadDeprecated.Usemin(Money)
insteadboolean
greaterThan
(Money<C> other) boolean
greaterThanOrEqual
(Money<C> other) boolean
boolean
grossToNetPercent
(int rate) grossToTaxPercent
(double rate) grossToTaxPercent
(int rate) int
hashCode()
boolean
boolean
lessThanOrEqual
(Money<C> other) boolean
boolean
multiply
(double other) multiply
(int other) negate()
negative()
Deprecated.Usenegate()
insteadstatic <C extends Money.Currency>
Money<C>nullToZero
(Money<C> value, C currency) static <C extends Money.Currency>
Money<C>[]splitProportionately
(Money<C> total, Money<C>[] weights) long
Deprecated.UseamountStore(Currency)
insteadstatic <C extends Money.Currency>
Money<C>storeOf
(long amountStore, C currency) static <C extends Money.Currency>
Money<C>static <C extends Money.Currency>
Money<C>toString()
static <C extends Money.Currency>
Money<C>valueOf
(double amount, C currency) static <C extends Money.Currency>
Money<C>static <C extends Money.Currency>
Money<C>valueOf
(BigDecimal value, C currency) static <C extends Money.Currency>
Money<C>zero
(C currency)
-
Method Details
-
storeOf
-
storeOf
-
storeOf
-
amountStore
-
getCurrency
-
equals
-
hashCode
public int hashCode() -
toString
-
toStringShort
-
zero
-
nullToZero
-
compareTo
- Specified by:
compareTo
in interfaceComparable<C extends Money.Currency>
-
equalsZero
public boolean equalsZero() -
lessThanZero
public boolean lessThanZero() -
greaterThanZero
public boolean greaterThanZero() -
lessThanOrEqualZero
public boolean lessThanOrEqualZero() -
greaterThanOrEqualZero
public boolean greaterThanOrEqualZero() -
lessThan
-
greaterThan
-
lessThanOrEqual
-
greaterThanOrEqual
-
min
-
max
-
negate
-
add
-
subtract
-
multiply
-
multiply
-
divide
-
grossToNetPercent
-
grossToTaxPercent
-
grossToTaxPercent
-
splitProportionately
public static <C extends Money.Currency> Money<C>[] splitProportionately(Money<C> total, Money<C>[] weights) -
array
-
valueOf
-
doubleAmount
-
valueOf
-
bigAmount
-
valueOf
-
getAmount
-
getAmount
Deprecated.BEWARE: UsegetAmount(Currency)
instead -
store
Deprecated.UseamountStore(Currency)
instead -
doubleValue
Deprecated.UsedoubleAmount(Currency)
instead -
bigValue
Deprecated.UsebigAmount(Currency)
instead -
getLower
Deprecated.Usemin(Money)
instead -
getGreater
Deprecated.Usemax(Money)
instead -
negative
Deprecated.Usenegate()
instead
-
bigAmount(Currency)
instead