Top Description Fields Constructors Methods
org.joda.money

public Class CurrencyMismatchException

extends IllegalArgumentException
Class Inheritance

Exception thrown when a monetary operation fails due to mismatched currencies.

For example, this exception would be thrown when trying to add a monetary value in one currency to a monetary value in a different currency.

This exception makes no guarantees about immutability or thread-safety.

Field Summary

Modifier and TypeField and Description
private final CurrencyUnit
firstCurrency

First currency.

private final CurrencyUnit
secondCurrency

Second currency.

private static final long

Constructor Summary

AccessConstructor and Description
public
CurrencyMismatchException(CurrencyUnit
the first currency, may be null
firstCurrency
,
CurrencyUnit
the second currency, not null
secondCurrency
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public CurrencyUnit

Returns:

the currency at fault, may be null
getFirstCurrency
()

Gets the first currency at fault.

public CurrencyUnit

Returns:

the currency at fault, may be null
getSecondCurrency
()

Gets the second currency at fault.

Field Detail

firstCurrencyback to summary
private final CurrencyUnit firstCurrency

First currency.

secondCurrencyback to summary
private final CurrencyUnit secondCurrency

Second currency.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.IllegalArgumentException.serialVersionUID.

Serialization lock.

Constructor Detail

CurrencyMismatchExceptionback to summary
public CurrencyMismatchException(CurrencyUnit firstCurrency, CurrencyUnit secondCurrency)

Constructor.

Parameters
firstCurrency:CurrencyUnit

the first currency, may be null

secondCurrency:CurrencyUnit

the second currency, not null

Method Detail

getFirstCurrencyback to summary
public CurrencyUnit getFirstCurrency()

Gets the first currency at fault.

Returns:CurrencyUnit

the currency at fault, may be null

getSecondCurrencyback to summary
public CurrencyUnit getSecondCurrency()

Gets the second currency at fault.

Returns:CurrencyUnit

the currency at fault, may be null