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.
| Modifier and Type | Field and Description |
|---|---|
| private final CurrencyUnit | firstCurrency
First currency. |
| private final CurrencyUnit | secondCurrency
Second currency. |
| private static final long | serialVersionUID
Serialization lock.
|
| Access | Constructor and Description |
|---|---|
| public | CurrencyMismatchException(CurrencyUnit
the first currency, may be null firstCurrency, CurrencyUnit the second currency, not null secondCurrency)Constructor. |
| Modifier and Type | Method and Description |
|---|---|
| public CurrencyUnit | |
| public CurrencyUnit |
| firstCurrency | back to summary |
|---|---|
| private final CurrencyUnit firstCurrency First currency. | |
| secondCurrency | back to summary |
|---|---|
| private final CurrencyUnit secondCurrency Second currency. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. Serialization lock. | |
| CurrencyMismatchException | back to summary |
|---|---|
| public CurrencyMismatchException(CurrencyUnit firstCurrency, CurrencyUnit secondCurrency) Constructor.
| |
| getFirstCurrency | back to summary |
|---|---|
| public CurrencyUnit getFirstCurrency() Gets the first currency at fault.
| |
| getSecondCurrency | back to summary |
|---|---|
| public CurrencyUnit getSecondCurrency() Gets the second currency at fault.
| |