package com.oreilly.patterns.chapter9;
import java.io.Serializable;
public final class SalesRecordKey implements Serializable {
public int saleId;
public SalesRecordKey() {}
public SalesRecordKey(int saleId) {
this.saleId = saleId;
}
public boolean equals(Object otherOb) {
if (this == otherOb) {
return true;
}
if (!(otherOb instanceof SalesRecordKey)) {
return false;
}
SalesRecordKey other = (SalesRecordKey) otherOb;
return (saleId == other.saleId);
}
public int hashCode() {
return saleId
}
}
|