java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
javax.money.MonetaryException
javax.money.convert.CurrencyConversionException
- All Implemented Interfaces:
Serializable
Exception thrown when a monetary conversion operation fails.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CurrencyUnitBase currency.private final ConversionContextThe acquiredConversionContext, may be null.private static final longSerialization lock.private final CurrencyUnitTerminating currency. -
Constructor Summary
ConstructorsConstructorDescriptionCurrencyConversionException(CurrencyUnit base, CurrencyUnit term, ConversionContext conversionContext) Constructs anCurrencyConversionExceptionwith the specified source and target currency.CurrencyConversionException(CurrencyUnit base, CurrencyUnit term, ConversionContext conversionContext, String message) Constructs anCurrencyConversionExceptionwith the specified detail message, timestamp, source and target currency.CurrencyConversionException(CurrencyUnit base, CurrencyUnit term, ConversionContext conversionContext, String message, Throwable cause) Constructs a new exception with the specified source and target currency, detail message and cause. -
Method Summary
Modifier and TypeMethodDescriptionGets the first currency at fault.Gets the queried timestamp at fault.Gets the second currency at fault.toString()Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization lock.- See Also:
-
base
Base currency. -
term
Terminating currency. -
conversionContext
The acquiredConversionContext, may be null.
-
-
Constructor Details
-
CurrencyConversionException
public CurrencyConversionException(CurrencyUnit base, CurrencyUnit term, ConversionContext conversionContext, String message) Constructs anCurrencyConversionExceptionwith the specified detail message, timestamp, source and target currency.- Parameters:
base- the source currency, may be null.term- the target currency, may be null.conversionContext- theConversionContextin place.message- the detail message.
-
CurrencyConversionException
public CurrencyConversionException(CurrencyUnit base, CurrencyUnit term, ConversionContext conversionContext) Constructs anCurrencyConversionExceptionwith the specified source and target currency.- Parameters:
base- the source currency, may be null.term- the target currency, may be null.conversionContext- theConversionContextin place.
-
CurrencyConversionException
public CurrencyConversionException(CurrencyUnit base, CurrencyUnit term, ConversionContext conversionContext, String message, Throwable cause) Constructs a new exception with the specified source and target currency, detail message and cause.Note that the detail message associated with
causeis not automatically incorporated in this exception's detail message.- Parameters:
base- the source currency, may be null.term- the target currency, may be null.conversionContext- theConversionContextin place.message- the detail message (which is saved for later retrieval by theThrowable.getMessage()method).cause- the cause (which is saved for later retrieval by theThrowable.getCause()method). (Anullvalue is permitted, and indicates that the cause is nonexistent or unknown.)
-
-
Method Details
-
getBaseCurrency
Gets the first currency at fault.- Returns:
- the currency at fault, may be null
-
getTermCurrency
Gets the second currency at fault.- Returns:
- the currency at fault, may be null
-
getConversionContext
Gets the queried timestamp at fault.- Returns:
- the queried timestamp, or
null.
-
toString
-