1 package org.apidesign.apifest08.currency;
4 import java.math.BigDecimal;
5 import java.util.Currency;
9 * Convert between two currencies.
11 * @author D'Arcy Smith
14 public interface Convertor
17 * Convert an amount from one currency to another.
19 * @param from the currency to convert from.
20 * @param to the currency to convert to.
21 * @param amount the amount to convert.
22 * @return the converted amount.
23 * @throws IllegalArgumentException if any of the arguments are null.
24 * @throws InvalidConversionException if either from or to are not valid for the convertor.
26 BigDecimal convert(Currency from,
29 throws InvalidConversionException;