FileDocCategorySizeDatePackage
Transaction.javaAPI DocExample7536Sun Dec 14 22:47:42 GMT 2003oreilly.hcj.bankdata

Transaction

public class Transaction extends oreilly.hcj.datamodeling.MutableObject
A transaction between two accounts.
author
Robert Simmons jr. (kraythe)
version
$Revision: 1.5 $

Fields Summary
public static final oreilly.hcj.datamodeling.constraints.StringConstraint
CODE_CONSTRAINT
Constraint for the property code.
public static final oreilly.hcj.datamodeling.constraints.ObjectConstraint
SOURCE_CONSTRAINT
Constraint for the property source.
public static final oreilly.hcj.datamodeling.constraints.ObjectConstraint
TARGET_CONSTRAINT
Constraint for the property target.
public static final oreilly.hcj.datamodeling.constraints.ObjectConstraint
SUCCESSFUL_CONSTRAINT
Constraint for the property successful.
public static final oreilly.hcj.datamodeling.constraints.ObjectConstraint
REQUESTER_CONSTRAINT
Constraint for the property requester.
public static final oreilly.hcj.datamodeling.constraints.DateConstraint
TIMESTAMP_CONSTRAINT
Constraint for the property timestamp.
public static final oreilly.hcj.datamodeling.constraints.NumericConstraint
AMOUNT_CONSTRAINT
Constraint for the property amount.
public static final oreilly.hcj.datamodeling.constraints.NumericConstraint
FEE_CONSTRAINT
Constraint for the property fee.
private Account
source
The source of the money being transferred.
private Account
target
The target of the money being transferred.
private Boolean
successful
Whether or not the transaction was executed successfully.
private Customer
requester
The customer requesting the transaction.
private Date
timestamp
The time and date of the transaction's attempted execution.
private Float
amount
The amount to be transferred.
private Float
fee
The fee charged for this transaction.
private String
code
Holds value of property code.
Constructors Summary
Methods Summary
public booleanequals(java.lang.Object obj)

see
java.lang.Object#equals(java.lang.Object)

		if (!(obj instanceof Transaction)) {
			return false;
		} else {
			return (((Transaction)obj).getCode().equals(this.code));
		}
	
public java.lang.FloatgetAmount()
Getter for property amount.

return
Value of property amount.

		return amount;
	
public java.lang.StringgetCode()
Getter for property code.

return
Value of property code.

		return this.code;
	
public java.lang.FloatgetFee()
Getter for property fee.

return
Value of property fee.

		return fee;
	
public CustomergetRequester()
Getter for property requester.

return
Value of property requester.

		return requester;
	
public AccountgetSource()
Getter for property source.

return
Value of property source.

		return source;
	
public java.lang.BooleangetSuccessful()
Getter for property successful.

return
Value of property successful.

		return successful;
	
public AccountgetTarget()
Getter for property target.

return
Value of property target.

		return target;
	
public java.util.DategetTimestamp()
Getter for property timestamp.

return
Value of property timestamp.

		return timestamp;
	
public inthashCode()

see
java.lang.Object#hashCode()

		return this.code.hashCode();
	
public voidsetAmount(java.lang.Float amount)
Setter for property amount.

param
amount New value of property amount.


	            	 
	     
		AMOUNT_CONSTRAINT.validate(amount);
		final Float oldAmount = this.amount;
		this.amount = amount;
		propertyChangeSupport.firePropertyChange("amount", oldAmount, this.amount);
	
public voidsetCode(java.lang.String code)
Setter for property code.

param
code New value of property code.

		CODE_CONSTRAINT.validate(code);
		final String oldCode = this.code;
		this.code = code;
		propertyChangeSupport.firePropertyChange("code", oldCode, code);
	
public voidsetFee(java.lang.Float fee)
Setter for property fee.

param
fee New value of property fee.

		FEE_CONSTRAINT.validate(fee);
		final Float oldFee = this.fee;
		this.fee = fee;
		propertyChangeSupport.firePropertyChange("fee", oldFee, this.fee);
	
public voidsetRequester(Customer requester)
Setter for property requester.

param
requester New value of property requester.

		REQUESTER_CONSTRAINT.validate(requester);
		final Customer oldRequester = this.requester;
		this.requester = requester;
		propertyChangeSupport.firePropertyChange("requester", oldRequester, this.requester);
	
public voidsetSource(Account source)
Setter for property source.

param
source New value of property source.

		SOURCE_CONSTRAINT.validate(source);
		final Account oldSource = this.source;
		this.source = source;
		propertyChangeSupport.firePropertyChange("source", oldSource, this.source);
	
public voidsetSuccessful(java.lang.Boolean successful)
Setter for property successful.

param
successful New value of property successful.

		SUCCESSFUL_CONSTRAINT.validate(successful);
		final Boolean oldSuccessful = this.successful;
		this.successful = successful;
		propertyChangeSupport.firePropertyChange("successful", oldSuccessful,
		                                         this.successful);
	
public voidsetTarget(Account target)
Setter for property target.

param
target New value of property target.

		TARGET_CONSTRAINT.validate(target);
		final Account oldTarget = this.target;
		this.target = target;
		propertyChangeSupport.firePropertyChange("target", oldTarget, this.target);
	
public voidsetTimestamp(java.util.Date timestamp)
Setter for property timestamp.

param
timestamp New value of property timestamp.

		TIMESTAMP_CONSTRAINT.validate(timestamp);
		final Date oldTimeStamp = this.timestamp;
		this.timestamp = timestamp;
		propertyChangeSupport.firePropertyChange("timestamp", oldTimeStamp, this.timestamp);