@Test public void testHashCode() { final int number = 101; DocumentReference documentReference = new DocumentReference("wiki", "space", "document"); DocumentReference classReference = new DocumentReference("wiki", "space", "class"); BaseObject o1 = new BaseObject(); o1.setDocumentReference(documentReference); o1.setXClassReference(classReference); BaseObject o2 = new BaseObject(); o2.setDocumentReference(documentReference); o2.setXClassReference(classReference); o1.setNumber(number); o2.setNumber(number); assertEquals(o1.hashCode(), o2.hashCode()); }
@Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); builder.appendSuper(super.hashCode()); builder.append(getNumber()); return builder.toHashCode(); }
BaseObject extends BaseCollection<BaseObjectReference> implements ObjectInterface, Serializable, Cloneable { @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); builder.appendSuper(super.hashCode()); builder.append(getNumber()); return builder.toHashCode(); } }
BaseObject extends BaseCollection<BaseObjectReference> implements ObjectInterface, Serializable, Cloneable { @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); builder.appendSuper(super.hashCode()); builder.append(getNumber()); return builder.toHashCode(); }  }
BaseObject extends BaseCollection<BaseObjectReference> implements ObjectInterface, Serializable, Cloneable { @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); builder.appendSuper(super.hashCode()); builder.append(getNumber()); return builder.toHashCode(); }  @Deprecated @Override String getName(); @Deprecated @Override void setName(String name); @Override void setNumber(int number); @Override void setXClassReference(EntityReference xClassReference); void displayHidden(StringBuffer buffer, String name, String prefix, XWikiContext context); void displayView(StringBuffer buffer, String name, String prefix, XWikiContext context); void displayEdit(StringBuffer buffer, String name, String prefix, XWikiContext context); String displayHidden(String name, String prefix, XWikiContext context); String displayView(String name, String prefix, XWikiContext context); String displayEdit(String name, String prefix, XWikiContext context); String displayHidden(String name, XWikiContext context); String displayView(String name, XWikiContext context); String displayEdit(String name, XWikiContext context); @Override BaseObject clone(); BaseObject duplicate(); BaseObject duplicate(DocumentReference documentReference); @Override boolean equals(Object obj); @Override int hashCode(); @Override void fromXML(Element oel); @Override List<ObjectDiff> getDiff(Object oldEntity, XWikiContext context); com.xpn.xwiki.api.Object newObjectApi(BaseObject obj, XWikiContext context); void set(String fieldname, java.lang.Object value, XWikiContext context); String getGuid(); void setGuid(String guid); @Override void setOwnerDocument(XWikiDocument ownerDocument); }
BaseObject extends BaseCollection<BaseObjectReference> implements ObjectInterface, Serializable, Cloneable { @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); builder.appendSuper(super.hashCode()); builder.append(getNumber()); return builder.toHashCode(); }  @Deprecated @Override String getName(); @Deprecated @Override void setName(String name); @Override void setNumber(int number); @Override void setXClassReference(EntityReference xClassReference); void displayHidden(StringBuffer buffer, String name, String prefix, XWikiContext context); void displayView(StringBuffer buffer, String name, String prefix, XWikiContext context); void displayEdit(StringBuffer buffer, String name, String prefix, XWikiContext context); String displayHidden(String name, String prefix, XWikiContext context); String displayView(String name, String prefix, XWikiContext context); String displayEdit(String name, String prefix, XWikiContext context); String displayHidden(String name, XWikiContext context); String displayView(String name, XWikiContext context); String displayEdit(String name, XWikiContext context); @Override BaseObject clone(); BaseObject duplicate(); BaseObject duplicate(DocumentReference documentReference); @Override boolean equals(Object obj); @Override int hashCode(); @Override void fromXML(Element oel); @Override List<ObjectDiff> getDiff(Object oldEntity, XWikiContext context); com.xpn.xwiki.api.Object newObjectApi(BaseObject obj, XWikiContext context); void set(String fieldname, java.lang.Object value, XWikiContext context); String getGuid(); void setGuid(String guid); @Override void setOwnerDocument(XWikiDocument ownerDocument);  }