task1/solution04/src/org/apidesign/apifest08/currency/InvalidConversionException.java
1 package org.apidesign.apifest08.currency;
4 import java.util.Currency;
8 * Thrown when a currency is invalid for a given Convertor.
10 * @author D'Arcy Smith
13 public class InvalidConversionException
17 * The currency that was tried.
19 private final Currency badCurrency;
22 * A currency that is valid for the Convertor.
24 private final Currency currencyA;
27 * A currency that is valid for the Convertor.
29 private final Currency currencyB;
32 * Construct a new InvalidConversionException wit the specified message.
34 * @param msg the message for getMessage.
35 * @param bad the currency that is not valid.
36 * @param a a valid currency.
37 * @param b a valid currency.
39 public InvalidConversionException(final String msg,
52 * Get the currency that is not valid.
54 * @return the badCurrency
56 public Currency getBadCurrency()
62 * Get a currency that is valid.
64 * @return the currencyA passed to the constructor.
66 public Currency getCurrencyA()
72 * Get a currency that is valid.
74 * @return the currencyB passed to the constructor.
76 public Currency getCurrencyB()