author | Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
Sat, 11 Oct 2008 23:38:46 +0200 | |
changeset 61 | 58ec6da75f6f |
parent 45 | task3/solution02/src/org/apidesign/apifest08/currency/Convertor.java@251d0ed461fb |
permissions | -rw-r--r-- |
japod@6 | 1 |
package org.apidesign.apifest08.currency; |
japod@6 | 2 |
|
japod@6 | 3 |
import java.util.Currency; |
japod@6 | 4 |
|
japod@6 | 5 |
|
japod@6 | 6 |
/** |
japod@16 | 7 |
* Converts currencies. To create an instance call {@link ConvertorFactory#createConvertor(Money, Money)}. |
japod@6 | 8 |
*/ |
japod@6 | 9 |
public interface Convertor { |
japod@6 | 10 |
/** |
japod@16 | 11 |
* Converts amount to its equivalent in the destination currency. |
japod@16 | 12 |
* @param amount |
japod@16 | 13 |
* @param destinationCurrency |
japod@6 | 14 |
* @return |
japod@16 | 15 |
* @throws IllegalArgumentException if currency of the amount is not supported or if it is not possible to convert it to the destination currency. |
japod@6 | 16 |
*/ |
japod@16 | 17 |
public Money convert(Money amount, Currency destinationCurrency) throws IllegalArgumentException; |
japod@6 | 18 |
} |