FileDocCategorySizeDatePackage
CustomerKey.javaAPI DocExample559Mon Nov 24 22:06:38 GMT 2003com.oreilly.patterns.chapter9

CustomerKey.java

package com.oreilly.patterns.chapter9;

import java.io.Serializable;

public final class CustomerKey implements Serializable {
    
    public int customerId;
           
    public boolean equals(Object otherOb) {
        
        if (this == otherOb) {
            return true;
        }
        if (!(otherOb instanceof CustomerKey)) {
            return false;
        }
        
	CustomerKey other = (CustomerKey) otherOb;
        
	return (customerId == other.customerId);
    }
    
    public int hashCode() {
        return customerId;
    }
    
}