private String string;
private Integer integer;
private OtherObject otherObject;
+ private OtherObject anotherObject;
public String getString() {
return string;
public void setOtherObject(OtherObject otherObject) {
this.otherObject = otherObject;
}
+
+ public OtherObject getAnotherObject() {
+ return anotherObject;
+ }
+
+ public void setAnotherObject(OtherObject anotherObject) {
+ this.anotherObject = anotherObject;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return string.equals(((SimpleObject) obj).string);
+ }
+
+ @Override
+ public int hashCode() {
+ return string.hashCode();
+ }
+
}