FileDocCategorySizeDatePackage
Customer.javaAPI DocExample5375Sun Dec 14 22:47:40 GMT 2003oreilly.hcj.datamodeling

Customer

public class Customer extends MutableObject
A customer object.
author
Robert Simmons jr. (kraythe)
version
$Revision: 1.5 $

Fields Summary
public static final oreilly.hcj.datamodeling.constraints.NumericConstraint
CUSTOMER_ID_CONSTRAINT
Constraint for the property customerID.
public static final oreilly.hcj.datamodeling.constraints.StringConstraint
FIRST_NAME_CONSTRAINT
Constraint for the property firstName.
public static final oreilly.hcj.datamodeling.constraints.StringConstraint
LAST_NAME_CONSTRAINT
Constraint for the property lastName.
public static final oreilly.hcj.datamodeling.constraints.StringConstraint
PHONE_CONSTRAINT
Constraint for the property phone.
public static final oreilly.hcj.datamodeling.constraints.CollectionConstraint
PURCHASES_CONSTRAINT
Constraint for the property purchases.
Integer
customerID
Holds the value of the property customerID.
List
purchases
Holds the value of the property purchases.
String
firstName
Holds the value of the property firstName.
String
lastName
Holds the value of the property lastName.
String
phone
Holds the value of the property phone.
Constructors Summary
Methods Summary
public booleanequals(java.lang.Object obj)

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

		if (!(obj instanceof Customer)) {
			return false;
		} else {
			return (((Customer)obj).getCustomerID().equals(this.customerID));
		}
	
public java.lang.IntegergetCustomerID()
Gets the value of the property customerID.

return
customerID The new value.

		return this.customerID;
	
public java.lang.StringgetFirstName()
Gets the value of the property firstName.

return
firstName The new value.

		return this.firstName;
	
public java.lang.StringgetLastName()
Gets the value of the property lastName.

return
lastName The new value.

		return this.lastName;
	
public java.lang.StringgetPhone()
Gets the value of the property phone.

return
phone The new value.

		return this.phone;
	
public java.util.ListgetPurchases()
Gets the value of the property purchases.

return
purchases The new value.

		return Collections.unmodifiableList(this.purchases);
	
public inthashCode()

see
java.lang.Object#hashCode()

		return this.customerID.hashCode();
	
public voidsetCustomerID(java.lang.Integer customerID)
Sets the value of the property customerID.

param
customerID The new value.


	             	 
	     
		CUSTOMER_ID_CONSTRAINT.validate(customerID);
		final Integer oldCustomerID = this.customerID;
		this.customerID = customerID;
		propertyChangeSupport.firePropertyChange("customerID", oldCustomerID,
		                                         this.customerID);
	
public voidsetFirstName(java.lang.String firstName)
Sets the value of the property firstName.

param
firstName The new value.

		FIRST_NAME_CONSTRAINT.validate(firstName);
		final String oldFirstName = this.firstName;
		this.firstName = firstName;
		propertyChangeSupport.firePropertyChange("firstName", oldFirstName, this.firstName);
	
public voidsetLastName(java.lang.String lastName)
Sets the value of the property lastName.

param
lastName The new value.

		LAST_NAME_CONSTRAINT.validate(lastName);
		final String oldLastName = this.lastName;
		this.lastName = lastName;
		propertyChangeSupport.firePropertyChange("lastName", oldLastName, this.lastName);
	
public voidsetPhone(java.lang.String phone)
Sets the value of the property phone.

param
phone The new value.

		PHONE_CONSTRAINT.validate(phone);
		final String oldPhone = this.phone;
		this.phone = phone;
		propertyChangeSupport.firePropertyChange("phone", oldPhone, this.phone);
	
public voidsetPurchases(java.util.List purchases)
Sets the value of the property purchases.

param
purchases The new value.

		PURCHASES_CONSTRAINT.validate(purchases);
		final List oldPurchases = getPurchases();
		this.purchases = new ArrayList(purchases);
		propertyChangeSupport.firePropertyChange("purchases", oldPurchases, this.purchases);