public class CurrencyMismatchException extends javax.money.MonetaryException
MonetaryAmount
passed to
arithmetic operations on another MonetaryAmount
is not compatible.
For example, this exception would be thrown when trying to multiply a
MonetaryAmount
in (ISO-4217) CHF with a a MonetaryAmount
in
(ISO-4217) USD.
Constructor and Description |
---|
CurrencyMismatchException(javax.money.CurrencyUnit source,
javax.money.CurrencyUnit target)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
javax.money.CurrencyUnit |
getSource()
Access the source
CurrencyUnit instance. |
javax.money.CurrencyUnit |
getTarget()
Access the target
CurrencyUnit instance. |
String |
toString() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
public CurrencyMismatchException(javax.money.CurrencyUnit source, javax.money.CurrencyUnit target)
source
- the source currency, not null
.target
- the mismatching target currency, not null
.Copyright © 2012–2013 JSR 354 - Expert Group. All rights reserved.