01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2002,2008 Oracle. All rights reserved.
05: *
06: * $Id: PartData.java,v 1.12.2.2 2008/01/07 15:14:00 cwl Exp $
07: */
08:
09: package collections.ship.entity;
10:
11: import java.io.Serializable;
12:
13: /**
14: * A PartData serves as the value in the key/value pair for a part entity.
15: *
16: * <p> In this sample, PartData is used only as the storage data for the
17: * value, while the Part object is used as the value's object representation.
18: * Because it is used directly as storage data using serial format, it must be
19: * Serializable. </p>
20: *
21: * @author Mark Hayes
22: */
23: public class PartData implements Serializable {
24:
25: private String name;
26: private String color;
27: private Weight weight;
28: private String city;
29:
30: public PartData(String name, String color, Weight weight,
31: String city) {
32:
33: this .name = name;
34: this .color = color;
35: this .weight = weight;
36: this .city = city;
37: }
38:
39: public final String getName() {
40:
41: return name;
42: }
43:
44: public final String getColor() {
45:
46: return color;
47: }
48:
49: public final Weight getWeight() {
50:
51: return weight;
52: }
53:
54: public final String getCity() {
55:
56: return city;
57: }
58:
59: public String toString() {
60:
61: return "[PartData: name=" + name + " color=" + color
62: + " weight=" + weight + " city=" + city + ']';
63: }
64: }
|