01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2002,2008 Oracle. All rights reserved.
05: *
06: * $Id: ShipmentKey.java,v 1.12.2.2 2008/01/07 15:14:00 cwl Exp $
07: */
08:
09: package collections.ship.basic;
10:
11: import java.io.Serializable;
12:
13: /**
14: * A ShipmentKey serves as the key in the key/data pair for a shipment entity.
15: *
16: * <p> In this sample, ShipmentKey is used both as the storage entry for the
17: * key as well as the object binding to the key. Because it is used directly
18: * as storage data using serial format, it must be Serializable. </p>
19: *
20: * @author Mark Hayes
21: */
22: public class ShipmentKey implements Serializable {
23:
24: private String partNumber;
25: private String supplierNumber;
26:
27: public ShipmentKey(String partNumber, String supplierNumber) {
28:
29: this .partNumber = partNumber;
30: this .supplierNumber = supplierNumber;
31: }
32:
33: public final String getPartNumber() {
34:
35: return partNumber;
36: }
37:
38: public final String getSupplierNumber() {
39:
40: return supplierNumber;
41: }
42:
43: public String toString() {
44:
45: return "[ShipmentKey: supplier=" + supplierNumber + " part="
46: + partNumber + ']';
47: }
48: }
|