task2/solution10/src/org/apidesign/apifest08/currency/CurrencyNotAvailableException.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Wed, 01 Oct 2008 10:43:05 +0200
changeset 29 f6073056b9fe
parent 6 task1/solution10/src/org/apidesign/apifest08/currency/CurrencyNotAvailableException.java@97662396c0fd
permissions -rw-r--r--
Getting ready for task2: copying all solutions to new locations
     1 package org.apidesign.apifest08.currency;
     2 
     3 import java.util.*;
     4 
     5 public final class CurrencyNotAvailableException extends RuntimeException {
     6 
     7 	private final Currency currency;
     8 
     9 	CurrencyNotAvailableException(Currency currency) {
    10 		this(currency, String.format("Currency %1$s not available", currency));	
    11 	}
    12 
    13 	CurrencyNotAvailableException(Currency currency, String message) {
    14 		super(message);
    15 		this.currency = currency;
    16 	}
    17 
    18 	public Currency getCurrency() {
    19 		return currency;
    20 	}
    21 }