MonetaryAmount,
by providing the common functionality. The different explicitly typed methods
are all reduced to methods using BigDecimal as input, hereby
performing any conversion to BigDecimal as needed. Obviously this
takes some time, so implementors that want to avoid this overhead should
implement MonetaryAmount directly.
| Modifier and Type | Field and Description |
|---|---|
| private static final Logger | |
| public static final char | |
| public static final String | |
| public static final char | |
| public static final String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static void | checkAmountParameter(MonetaryAmount
The monetary amount to be compared to, never null. amount, CurrencyUnit the currency unit to compare, never null. currencyUnit)Method to check if a currency is compatible with this amount instance. |
| public static void | checkNumberParameter(Number
the number to be checked. number)Internal method to check for correct number parameter. |
| public static BigDecimal | Returns: the correspondingBigDecimalthe number type num)Creates a |
| public static BigDecimal | Returns: the correspondingBigDecimalthe number type num)Creates a |
| public static BigDecimal | Returns: the correspondingBigDecimalthe number type num)Creates a |
| public static BigDecimal | Returns: the correspondingBigDecimalthe number type num, MonetaryContext moneyContext)Creates a |
| public static MathContext | Returns: the correspondingMathContextthe monetaryContext, RoundingMode MonetaryContextthe default defaultMode)RoundingMode, to be used if no one is set
in MonetaryContext.Evaluates the |
| public static String | replaceNbspWithSpace(String s)
Replaces the non-breaking space character U+00A0 and Narrow non-breaking space U+202F from the string with usual space. |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| NBSP | back to summary |
|---|---|
| public static final char NBSP | |
| NBSP_STRING | back to summary |
|---|---|
| public static final String NBSP_STRING | |
| NNBSP | back to summary |
|---|---|
| public static final char NNBSP | |
| NNBSP_STRING | back to summary |
|---|---|
| public static final String NNBSP_STRING | |
| MoneyUtils | back to summary |
|---|---|
| private MoneyUtils() | |
| checkAmountParameter | back to summary |
|---|---|
| public static void checkAmountParameter(MonetaryAmount amount, CurrencyUnit currencyUnit) Method to check if a currency is compatible with this amount instance.
| |
| checkNumberParameter | back to summary |
|---|---|
| public static void checkNumberParameter(Number number) Internal method to check for correct number parameter.
| |
| getBigDecimal | back to summary |
|---|---|
| public static BigDecimal getBigDecimal(long num) Creates a
| |
| getBigDecimal | back to summary |
|---|---|
| public static BigDecimal getBigDecimal(double num) Creates a
| |
| getBigDecimal | back to summary |
|---|---|
| public static BigDecimal getBigDecimal(Number num) Creates a
| |
| getBigDecimal | back to summary |
|---|---|
| public static BigDecimal getBigDecimal(Number num, MonetaryContext moneyContext) Creates a
| |
| getMathContext | back to summary |
|---|---|
| public static MathContext getMathContext(MonetaryContext monetaryContext, RoundingMode defaultMode) Evaluates the
| |
| replaceNbspWithSpace | back to summary |
|---|---|
| public static String replaceNbspWithSpace(String s) Replaces the non-breaking space character U+00A0 and Narrow non-breaking space U+202F from the string with usual space. https://en.wikipedia.org/wiki/Non-breaking_space} | |