package com.hammurapi.common.extract.tests;

import java.math.BigDecimal;
import java.util.Date;

import com.hammurapi.store.StoreException;

/**
 * Test class
 * @author Pavel Vlasov
 *
 */
public class Transaction {
	
	private boolean delayed;

	public Transaction(boolean delayed) {
		this.delayed = delayed;
	}

	private BigDecimal amount;
	private Date date;
	
	public BigDecimal getAmount() {
		if (delayed) {
			// Artificial delay to test parallel processing.
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				throw new StoreException(e);
			}
		}
		return amount;
	}
	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	
	
}
