1 8 package com.sleepycat.collections.test.serial; 9 10 14 class TestSerial implements java.io.Serializable { 15 16 static final long serialVersionUID = -3738980000390384920L; 17 18 private int i = 123; 19 private TestSerial other; 20 21 private String s = "string"; 28 29 TestSerial(TestSerial other) { 30 31 this.other = other; 32 } 33 34 TestSerial getOther() { 35 36 return other; 37 } 38 39 int getIntField() { 40 41 return i; 42 } 43 44 String getStringField() { 45 46 return s; } 48 49 public boolean equals(Object object) { 50 51 try { 52 TestSerial o = (TestSerial) object; 53 if ((o.other == null) ? (this.other != null) 54 : (!o.other.equals(this.other))) { 55 return false; 56 } 57 if (this.i != o.i) { 58 return false; 59 } 60 if ((o.s == null) ? (this.s != null) 62 : (!o.s.equals(this.s))) { 63 return false; 64 } 65 return true; 66 } catch (ClassCastException e) { 67 return false; 68 } 69 } 70 } 71 | Popular Tags |