@Test public void equalsTo() { EntityReference documentReference = new EntityReference("page", EntityType.DOCUMENT, new EntityReference("space", EntityType.SPACE, new EntityReference("wiki", EntityType.WIKI))); EntityReference localdocumentReference = new EntityReference("page", EntityType.DOCUMENT, new EntityReference("space", EntityType.SPACE)); assertTrue(localdocumentReference.equals(documentReference, EntityType.SPACE)); assertTrue(documentReference.equals(localdocumentReference, EntityType.SPACE)); EntityReference localdocumentReference2 = new EntityReference("page", EntityType.DOCUMENT, new EntityReference("space2", EntityType.SPACE)); assertFalse(localdocumentReference.equals(localdocumentReference2, EntityType.SPACE)); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof EntityReference)) { return false; } EntityReference ref = (EntityReference) obj; return name.equals(ref.name) && type.equals(ref.type) && (parent == null ? ref.parent == null : parent.equals(ref.parent)) && (parameters == null ? ref.parameters == null : parameters.equals(ref.parameters)); }
EntityReference implements Serializable, Cloneable, Comparable<EntityReference> { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof EntityReference)) { return false; } EntityReference ref = (EntityReference) obj; return name.equals(ref.name) && type.equals(ref.type) && (parent == null ? ref.parent == null : parent.equals(ref.parent)) && (parameters == null ? ref.parameters == null : parameters.equals(ref.parameters)); } }
EntityReference implements Serializable, Cloneable, Comparable<EntityReference> { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof EntityReference)) { return false; } EntityReference ref = (EntityReference) obj; return name.equals(ref.name) && type.equals(ref.type) && (parent == null ? ref.parent == null : parent.equals(ref.parent)) && (parameters == null ? ref.parameters == null : parameters.equals(ref.parameters)); } EntityReference(EntityReference reference);  EntityReference(EntityReference reference, EntityReference parent); protected  EntityReference(EntityReference reference, EntityReference oldReference, EntityReference newReference);  EntityReference(String name, EntityType type);  EntityReference(String name, EntityType type, EntityReference parent); @Unstable  EntityReference(String name, EntityType type, Map<String, Serializable> parameters);  EntityReference(String name, EntityType type, EntityReference parent, Map<String, Serializable> parameters); @Unstable  EntityReference(EntityReference reference, Map<String, Serializable> parameters); }
EntityReference implements Serializable, Cloneable, Comparable<EntityReference> { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof EntityReference)) { return false; } EntityReference ref = (EntityReference) obj; return name.equals(ref.name) && type.equals(ref.type) && (parent == null ? ref.parent == null : parent.equals(ref.parent)) && (parameters == null ? ref.parameters == null : parameters.equals(ref.parameters)); } EntityReference(EntityReference reference);  EntityReference(EntityReference reference, EntityReference parent); protected  EntityReference(EntityReference reference, EntityReference oldReference, EntityReference newReference);  EntityReference(String name, EntityType type);  EntityReference(String name, EntityType type, EntityReference parent); @Unstable  EntityReference(String name, EntityType type, Map<String, Serializable> parameters);  EntityReference(String name, EntityType type, EntityReference parent, Map<String, Serializable> parameters); @Unstable  EntityReference(EntityReference reference, Map<String, Serializable> parameters); final String getName(); final EntityReference getParent(); final EntityType getType(); final Map<String, Serializable> getParameters(); @Transient EntityReference getRoot(); @Transient List<EntityReference> getReversedReferenceChain(); int size(); EntityReference extractReference(EntityType type); EntityReference extractFirstReference(EntityType type); EntityReference replaceParent(EntityReference oldParent, EntityReference newParent); EntityReference replaceParent(EntityReference newParent); EntityReference appendParent(EntityReference newParent); EntityReference removeParent(EntityReference oldParent); boolean hasParent(EntityReference expectedParent); @Override String toString(); @Override boolean equals(Object obj); boolean equals(EntityReference otherReference, EntityType to); boolean equals(EntityReference otherReference, EntityType from, EntityType to); boolean equalsNonRecursive(EntityReference otherReference); @Override int hashCode(); @Override int compareTo(EntityReference reference); }
EntityReference implements Serializable, Cloneable, Comparable<EntityReference> { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof EntityReference)) { return false; } EntityReference ref = (EntityReference) obj; return name.equals(ref.name) && type.equals(ref.type) && (parent == null ? ref.parent == null : parent.equals(ref.parent)) && (parameters == null ? ref.parameters == null : parameters.equals(ref.parameters)); } EntityReference(EntityReference reference);  EntityReference(EntityReference reference, EntityReference parent); protected  EntityReference(EntityReference reference, EntityReference oldReference, EntityReference newReference);  EntityReference(String name, EntityType type);  EntityReference(String name, EntityType type, EntityReference parent); @Unstable  EntityReference(String name, EntityType type, Map<String, Serializable> parameters);  EntityReference(String name, EntityType type, EntityReference parent, Map<String, Serializable> parameters); @Unstable  EntityReference(EntityReference reference, Map<String, Serializable> parameters); final String getName(); final EntityReference getParent(); final EntityType getType(); final Map<String, Serializable> getParameters(); @Transient EntityReference getRoot(); @Transient List<EntityReference> getReversedReferenceChain(); int size(); EntityReference extractReference(EntityType type); EntityReference extractFirstReference(EntityType type); EntityReference replaceParent(EntityReference oldParent, EntityReference newParent); EntityReference replaceParent(EntityReference newParent); EntityReference appendParent(EntityReference newParent); EntityReference removeParent(EntityReference oldParent); boolean hasParent(EntityReference expectedParent); @Override String toString(); @Override boolean equals(Object obj); boolean equals(EntityReference otherReference, EntityType to); boolean equals(EntityReference otherReference, EntityType from, EntityType to); boolean equalsNonRecursive(EntityReference otherReference); @Override int hashCode(); @Override int compareTo(EntityReference reference);  }