1/*- 2 * See the file LICENSE for redistribution information. 3 * 4 * Copyright (c) 2002,2008 Oracle. All rights reserved. 5 * 6 * $Id: PartData.java,v 12.7 2008/01/08 20:58:29 bostic Exp $ 7 */ 8 9package collections.ship.entity; 10 11import 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 */ 23public 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, String city) { 31 32 this.name = name; 33 this.color = color; 34 this.weight = weight; 35 this.city = city; 36 } 37 38 public final String getName() { 39 40 return name; 41 } 42 43 public final String getColor() { 44 45 return color; 46 } 47 48 public final Weight getWeight() { 49 50 return weight; 51 } 52 53 public final String getCity() { 54 55 return city; 56 } 57 58 public String toString() { 59 60 return "[PartData: name=" + name + 61 " color=" + color + 62 " weight=" + weight + 63 " city=" + city + ']'; 64 } 65} 66