1 8 9 package collections.ship.factory; 10 11 import com.sleepycat.bind.tuple.MarshalledTupleEntry; 12 import com.sleepycat.bind.tuple.TupleInput; 13 import com.sleepycat.bind.tuple.TupleOutput; 14 15 24 public class ShipmentKey implements MarshalledTupleEntry { 25 26 private String partNumber; 27 private String supplierNumber; 28 29 public ShipmentKey(String partNumber, String supplierNumber) { 30 31 this.partNumber = partNumber; 32 this.supplierNumber = supplierNumber; 33 } 34 35 public final String getPartNumber() { 36 37 return partNumber; 38 } 39 40 public final String getSupplierNumber() { 41 42 return supplierNumber; 43 } 44 45 public String toString() { 46 47 return "[ShipmentKey: supplier=" + supplierNumber + 48 " part=" + partNumber + ']'; 49 } 50 51 53 public ShipmentKey() { 54 55 } 58 59 public void marshalEntry(TupleOutput keyOutput) { 60 61 keyOutput.writeString(this.partNumber); 62 keyOutput.writeString(this.supplierNumber); 63 } 64 65 public void unmarshalEntry(TupleInput keyInput) { 66 67 this.partNumber = keyInput.readString(); 68 this.supplierNumber = keyInput.readString(); 69 } 70 } 71 | Popular Tags |