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 TypeMethodDescriptionlongamountStore(C currency) static <CURRENCY extends Money.Currency>
Money<CURRENCY>[]array(int size) Deprecated.intdivide(double other) doubledoubleAmount(Money.Currency currency) doubledoubleValue(Money.Currency currency) Deprecated.UsedoubleAmount(Currency)insteadbooleanbooleanDeprecated.getAmount(Money.Currency currency) getGreater(Money<C> other) Deprecated.Usemax(Money)insteadDeprecated.Usemin(Money)insteadbooleangreaterThan(Money<C> other) booleangreaterThanOrEqual(Money<C> other) booleanbooleangrossToNetPercent(int rate) grossToTaxPercent(double rate) grossToTaxPercent(int rate) inthashCode()booleanbooleanlessThanOrEqual(Money<C> other) booleanbooleanmultiply(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) longDeprecated.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:
compareToin 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