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