| 1 18 package net.sf.uitags.util; 19 20 26 public final class ObjectPair { 27 30 private Object first; 31 34 private Object second; 35 36 42 public ObjectPair(Object first, Object second) { 43 super(); 44 this.first = first; 45 this.second = second; 46 } 47 48 53 public Object getFirstObject() { 54 return this.first; 55 } 56 57 62 public Object getSecondObject() { 63 return this.second; 64 } 65 66 67 public boolean equals(Object obj) { 68 if (this == obj) { 69 return true; 70 } 71 72 if (!(obj instanceof ObjectPair)) { 73 return false; 74 } 75 76 ObjectPair temp = (ObjectPair) obj; 77 78 return 81 (this.first == null ? 82 temp.first == null : this.first.equals(temp.first)) && 83 (this.second == null ? 84 temp.second == null : this.second.equals(temp.second)); 85 } 86 87 88 public int hashCode() { 89 return 90 (this.first == null ? 0 : this.first.hashCode()) ^ 91 (this.second == null ? 0 : this.second.hashCode()); 92 } 93 } 94 | Popular Tags |