@Test public void testEquals() { assertTrue(new CompoundObjectId(new HashMap<>()).equals(new CompoundObjectId(new HashMap<>()))); Map<String, Object> ids1 = new HashMap<>(); ids1.put("id1", new Integer(1)); ids1.put("id2", "2"); CompoundObjectId objectId1 = new CompoundObjectId(ids1); assertTrue(objectId1.equals(objectId1)); CompoundObjectId objectId2 = new CompoundObjectId(ids1); assertTrue(objectId1.equals(objectId2)); Map<String, Object> ids3 = new HashMap<>(); ids3.put("id1", new Integer(1)); ids3.put("id2", "2"); CompoundObjectId objectId3 = new CompoundObjectId(ids3); assertTrue(objectId1.equals(objectId3)); }
@Override public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof CompoundObjectId)) { return false; } return id.equals(((CompoundObjectId)object).id); }
CompoundObjectId extends BaseObjectId { @Override public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof CompoundObjectId)) { return false; } return id.equals(((CompoundObjectId)object).id); } }
CompoundObjectId extends BaseObjectId { @Override public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof CompoundObjectId)) { return false; } return id.equals(((CompoundObjectId)object).id); } CompoundObjectId(Map<String, Object> id); }
CompoundObjectId extends BaseObjectId { @Override public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof CompoundObjectId)) { return false; } return id.equals(((CompoundObjectId)object).id); } CompoundObjectId(Map<String, Object> id); @Override Object get(String attributeName); @Override Object get(); @Override int size(); @Override String toString(); @Override boolean equals(Object object); @Override int hashCode(); static String mapToString(Map<String, Object> m); }
CompoundObjectId extends BaseObjectId { @Override public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof CompoundObjectId)) { return false; } return id.equals(((CompoundObjectId)object).id); } CompoundObjectId(Map<String, Object> id); @Override Object get(String attributeName); @Override Object get(); @Override int size(); @Override String toString(); @Override boolean equals(Object object); @Override int hashCode(); static String mapToString(Map<String, Object> m);  }