diff -r 251d0ed461fb -r 58ec6da75f6f task4/solution02/src/org/apidesign/apifest08/currency/Convertor.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/task4/solution02/src/org/apidesign/apifest08/currency/Convertor.java Sat Oct 11 23:38:46 2008 +0200 @@ -0,0 +1,18 @@ +package org.apidesign.apifest08.currency; + +import java.util.Currency; + + +/** + * Converts currencies. To create an instance call {@link ConvertorFactory#createConvertor(Money, Money)}. + */ +public interface Convertor { + /** + * Converts amount to its equivalent in the destination currency. + * @param amount + * @param destinationCurrency + * @return + * @throws IllegalArgumentException if currency of the amount is not supported or if it is not possible to convert it to the destination currency. + */ + public Money convert(Money amount, Currency destinationCurrency) throws IllegalArgumentException; +}