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
japod@6
     1
package org.apidesign.apifest08.currency;
japod@6
     2
japod@6
     3
import java.util.Currency;
jaroslav@64
     4
import java.util.Date;
japod@6
     5
japod@21
     6
public final class UnsupportedConversionException extends ConversionException{
japod@6
     7
japod@6
     8
	private static final long serialVersionUID = 1L; 
japod@6
     9
	
japod@6
    10
	private Currency from;
japod@6
    11
	private Currency to;
japod@6
    12
japod@6
    13
	public UnsupportedConversionException(Currency from, Currency to) {
japod@21
    14
		super("Conversion from  the currency " + from + " to the currency " + to + " or vice versa in not supported.");
japod@6
    15
		this.from = from;
japod@6
    16
		this.to = to;
japod@6
    17
	}
jaroslav@64
    18
	
jaroslav@64
    19
	public UnsupportedConversionException(Currency from, Currency to, Date time) {
jaroslav@64
    20
		super("Conversion from  the currency " + from + " to the currency " + to + " or vice versa in not supported for time " + time );
jaroslav@64
    21
		this.from = from;
jaroslav@64
    22
		this.to = to;
jaroslav@64
    23
	}
japod@6
    24
japod@6
    25
	public Currency getFrom() {
japod@6
    26
		return from;
japod@6
    27
	}
japod@6
    28
japod@6
    29
	public Currency getTo() {
japod@6
    30
		return to;
japod@6
    31
	}
japod@6
    32
	
japod@6
    33
	
japod@6
    34
}