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