00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 package collections.ship.factory;
00011
00012 import com.sleepycat.bind.tuple.MarshalledTupleEntry;
00013 import com.sleepycat.bind.tuple.TupleInput;
00014 import com.sleepycat.bind.tuple.TupleOutput;
00015
00025 public class ShipmentKey implements MarshalledTupleEntry {
00026
00027 private String partNumber;
00028 private String supplierNumber;
00029
00030 public ShipmentKey(String partNumber, String supplierNumber) {
00031
00032 this.partNumber = partNumber;
00033 this.supplierNumber = supplierNumber;
00034 }
00035
00036 public final String getPartNumber() {
00037
00038 return partNumber;
00039 }
00040
00041 public final String getSupplierNumber() {
00042
00043 return supplierNumber;
00044 }
00045
00046 public String toString() {
00047
00048 return "[ShipmentKey: supplier=" + supplierNumber +
00049 " part=" + partNumber + ']';
00050 }
00051
00052
00053
00054 public ShipmentKey() {
00055
00056
00057
00058 }
00059
00060 public void marshalEntry(TupleOutput keyOutput) {
00061
00062 keyOutput.writeString(this.partNumber);
00063 keyOutput.writeString(this.supplierNumber);
00064 }
00065
00066 public void unmarshalEntry(TupleInput keyInput) {
00067
00068 this.partNumber = keyInput.readString();
00069 this.supplierNumber = keyInput.readString();
00070 }
00071 }