T - the target class implementing MonetaryAmount.@Deprecated public abstract class AbstractAmountBuilder<T extends MonetaryAmount> extends Object implements MonetaryAmountFactory<T>
MonetaryAmountFactory, which simplifies development of the SPI interface.| Constructor and Description |
|---|
AbstractAmountBuilder()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
T |
create()
Deprecated.
Creates a new instance of
MonetaryAmount, using the default MonetaryContext. |
protected abstract T |
create(Number number,
CurrencyUnit currency,
MonetaryContext monetaryContext)
Deprecated.
|
protected static BigDecimal |
getBigDecimal(Number num)
Deprecated.
will be removed in next release
|
MonetaryContext |
getDefaultMonetaryContext()
Deprecated.
Returns the default
MonetaryContext used, when no MonetaryContext is
provided. |
MonetaryContext |
getMaximalMonetaryContext()
Deprecated.
Returns the maximal
MonetaryContext supported. |
protected abstract MonetaryContext |
loadDefaultMonetaryContext()
Deprecated.
|
protected abstract MonetaryContext |
loadMaxMonetaryContext()
Deprecated.
|
MonetaryAmountFactory<T> |
setAmount(MonetaryAmount amount)
Deprecated.
Converts (if necessary) the given
MonetaryAmount to a new MonetaryAmount
instance, hereby supporting the MonetaryContext given. |
MonetaryAmountFactory<T> |
setContext(MonetaryContext monetaryContext)
Deprecated.
|
MonetaryAmountFactory<T> |
setCurrency(CurrencyUnit currency)
Deprecated.
|
MonetaryAmountFactory<T> |
setCurrency(String currencyCode)
Deprecated.
|
MonetaryAmountFactory<T> |
setNumber(double number)
Deprecated.
Creates a new instance of
Monetary, using the default MonetaryContext. |
MonetaryAmountFactory<T> |
setNumber(long number)
Deprecated.
|
MonetaryAmountFactory<T> |
setNumber(Number number)
Deprecated.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAmountType, getMaxNumber, getMinNumberpublic AbstractAmountBuilder()
public T create()
MonetaryAmount, using the default MonetaryContext.create in interface MonetaryAmountFactory<T extends MonetaryAmount>MonetaryAmount combining the numeric value and currency unit.ArithmeticException - If the number exceeds the capabilities of the default MonetaryContext
used.protected abstract T create(Number number, CurrencyUnit currency, MonetaryContext monetaryContext)
protected abstract MonetaryContext loadDefaultMonetaryContext()
protected abstract MonetaryContext loadMaxMonetaryContext()
public MonetaryAmountFactory<T> setCurrency(CurrencyUnit currency)
setCurrency in interface MonetaryAmountFactory<T extends MonetaryAmount>public MonetaryAmountFactory<T> setNumber(Number number)
setNumber in interface MonetaryAmountFactory<T extends MonetaryAmount>public MonetaryAmountFactory<T> setCurrency(String currencyCode)
setCurrency in interface MonetaryAmountFactory<T extends MonetaryAmount>public MonetaryAmountFactory<T> setNumber(double number)
Monetary, using the default MonetaryContext.setNumber in interface MonetaryAmountFactory<T extends MonetaryAmount>number - numeric value.Money combining the numeric value and currency unit.ArithmeticException - If the number exceeds the capabilities of the default MonetaryContext
used.UnknownCurrencyException - if the currency code can not be resolved to CurrencyUnit.public MonetaryAmountFactory<T> setNumber(long number)
setNumber in interface MonetaryAmountFactory<T extends MonetaryAmount>public MonetaryAmountFactory<T> setContext(MonetaryContext monetaryContext)
setContext in interface MonetaryAmountFactory<T extends MonetaryAmount>public MonetaryContext getDefaultMonetaryContext()
MonetaryContext used, when no MonetaryContext is
provided.getDefaultMonetaryContext in interface MonetaryAmountFactory<T extends MonetaryAmount>MonetaryContext, never null.public MonetaryContext getMaximalMonetaryContext()
MonetaryContext supported.getMaximalMonetaryContext in interface MonetaryAmountFactory<T extends MonetaryAmount>MonetaryContext, never null.public MonetaryAmountFactory<T> setAmount(MonetaryAmount amount)
MonetaryAmount to a new MonetaryAmount
instance, hereby supporting the MonetaryContext given.setAmount in interface MonetaryAmountFactory<T extends MonetaryAmount>amount - the amount to be converted, if necessary.@Deprecated protected static BigDecimal getBigDecimal(Number num)
BigDecimal from the given Number doing the valid conversion
depending the type given.num - the number typeBigDecimalCopyright © 2012–2020 JavaMoney. All rights reserved.