1 22 package org.jboss.test.iiop.interfaces; 23 24 30 public class Zoo implements java.io.Serializable { 31 32 public String id; 33 public String name; 34 public Zoo inner; 35 private transient Object hidden = "hidden"; 36 37 public Zoo(String id, String name) { 38 this.id = id; 39 this.name = name; 40 this.inner = null; 41 } 42 43 public Zoo(String id, String name, Zoo inner) { 44 this.id = id; 45 this.name = name; 46 this.inner = inner; 47 } 48 49 public String toString() { 50 return "Zoo(" + id + ", \"" + name + "\"" + 51 ((inner == null) ? "" : ", " + inner.toString()) + ")"; 52 } 53 54 public boolean equals(Object o) { 55 return (o instanceof Zoo) 56 && (((Zoo)o).id.equals(id)) 57 && (((Zoo)o).name.equals(name)) 58 && ((((Zoo)o).inner == null && inner == null) 59 || (((Zoo)o).inner != null && ((Zoo)o).inner.equals(inner))); 60 } 61 62 private synchronized void writeObject(java.io.ObjectOutputStream s) 63 throws java.io.IOException { 64 id = id + "!"; 65 s.defaultWriteObject(); 66 } 67 } 68 | Popular Tags |