task1/solution02/src/org/apidesign/apifest08/currency/Convertor.java
author japod@localhost
Tue, 30 Sep 2008 11:47:02 +0200
changeset 16 2864c6d744c0
parent 6 97662396c0fd
permissions -rw-r--r--
solution 02 updated to 1.5
     1 package org.apidesign.apifest08.currency;
     2 
     3 import java.util.Currency;
     4 
     5 
     6 /** 
     7  * Converts currencies. To create an instance call {@link ConvertorFactory#createConvertor(Money, Money)}.
     8  */
     9 public interface Convertor {
    10 	/**
    11 	 * Converts amount to its equivalent in the destination currency. 
    12 	 * @param amount 
    13 	 * @param destinationCurrency
    14 	 * @return
    15 	 * @throws IllegalArgumentException if currency of the amount is not supported or if it is not possible to convert it to the destination currency.
    16 	 */
    17 	public Money convert(Money amount, Currency destinationCurrency) throws IllegalArgumentException;
    18 }