Update of /cvsroot/comxe/Trifon-HG-ERP/src/name/trifon/erp/model/currency
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29651/src/name/trifon/erp/model/currency
Added Files:
CurrencyRate.java
Log Message:
small refactoring.
--- NEW FILE: CurrencyRate.java ---
package name.trifon.erp.model.currency;
import java.util.Currency;
import name.trifon.erp.model.core.BaseModel;
import name.trifon.erp.model.misc.DateRange;
public class CurrencyRate implements BaseModel {
/**
*
*/
private static final long serialVersionUID = 5644207407472186994L;
private String searchKey; // Account code
private String name;
private String description;
private Currency fromCurrency;
private Currency toCurrency;
private DateRange period;
private Double rate;
public CurrencyRate(Currency from, Currency to, DateRange period, Double rate) throws IllegalArgumentException {
if (from == null) {
throw new IllegalArgumentException("Currency 'from' can't be null!");
}
if (to == null) {
throw new IllegalArgumentException("Currency 'to' can't be null!");
}
if (period == null) {
throw new IllegalArgumentException("Period can't be null!");
}
if (rate == null) {
throw new IllegalArgumentException("Currency Exchange Rate can't be null!");
}
fromCurrency = from;
}
public String getSearchKey() {
return searchKey;
}
public void setSearchKey(String key) {
this.searchKey = key;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the description
*/
public String getDescription() {
return description;
}
/**
* @param description the description to set
*/
public void setDescription(String description) {
this.description = description;
}
/**
* @return the fromCurrency
*/
public Currency getFromCurrency() {
return fromCurrency;
}
/**
* @return the toCurrency
*/
public Currency getToCurrency() {
return toCurrency;
}
/**
* @return the period
*/
public DateRange getPeriod() {
return period;
}
/**
* @return the rate
*/
public Double getRate() {
return rate;
}
}
|