task4/solution06/src/org/apidesign/apifest08/currency/UnsupportedConversionException.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Fri, 17 Oct 2008 17:32:34 +0200
changeset 64 51f7b894eba6
parent 61 58ec6da75f6f
permissions -rw-r--r--
Solution 6, task 4
     1 package org.apidesign.apifest08.currency;
     2 
     3 import java.util.Currency;
     4 import java.util.Date;
     5 
     6 public final class UnsupportedConversionException extends ConversionException{
     7 
     8 	private static final long serialVersionUID = 1L; 
     9 	
    10 	private Currency from;
    11 	private Currency to;
    12 
    13 	public UnsupportedConversionException(Currency from, Currency to) {
    14 		super("Conversion from  the currency " + from + " to the currency " + to + " or vice versa in not supported.");
    15 		this.from = from;
    16 		this.to = to;
    17 	}
    18 	
    19 	public UnsupportedConversionException(Currency from, Currency to, Date time) {
    20 		super("Conversion from  the currency " + from + " to the currency " + to + " or vice versa in not supported for time " + time );
    21 		this.from = from;
    22 		this.to = to;
    23 	}
    24 
    25 	public Currency getFrom() {
    26 		return from;
    27 	}
    28 
    29 	public Currency getTo() {
    30 		return to;
    31 	}
    32 	
    33 	
    34 }