@Test public void equalsNonRecursive() { EntityReference documentReference1 = new EntityReference("page", EntityType.DOCUMENT, new EntityReference("space", EntityType.SPACE, new EntityReference("wiki", EntityType.WIKI))); EntityReference documentReference2 = new EntityReference("page", EntityType.DOCUMENT, new EntityReference("space2", EntityType.SPACE, new EntityReference("wiki2", EntityType.WIKI))); assertTrue(documentReference1.equalsNonRecursive(documentReference2)); assertFalse(documentReference1.getParent().equalsNonRecursive(documentReference2.getParent())); }
public boolean equalsNonRecursive(EntityReference otherReference) { if (otherReference == this) { return true; } if (otherReference == null) { return false; } return name.equals(otherReference.name) && type.equals(otherReference.type) && (parameters == null ? otherReference.parameters == null : parameters.equals(otherReference.parameters)); }
EntityReference implements Serializable, Cloneable, Comparable<EntityReference> { public boolean equalsNonRecursive(EntityReference otherReference) { if (otherReference == this) { return true; } if (otherReference == null) { return false; } return name.equals(otherReference.name) && type.equals(otherReference.type) && (parameters == null ? otherReference.parameters == null : parameters.equals(otherReference.parameters)); } }
EntityReference implements Serializable, Cloneable, Comparable<EntityReference> { public boolean equalsNonRecursive(EntityReference otherReference) { if (otherReference == this) { return true; } if (otherReference == null) { return false; } return name.equals(otherReference.name) && type.equals(otherReference.type) && (parameters == null ? otherReference.parameters == null : parameters.equals(otherReference.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> { public boolean equalsNonRecursive(EntityReference otherReference) { if (otherReference == this) { return true; } if (otherReference == null) { return false; } return name.equals(otherReference.name) && type.equals(otherReference.type) && (parameters == null ? otherReference.parameters == null : parameters.equals(otherReference.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> { public boolean equalsNonRecursive(EntityReference otherReference) { if (otherReference == this) { return true; } if (otherReference == null) { return false; } return name.equals(otherReference.name) && type.equals(otherReference.type) && (parameters == null ? otherReference.parameters == null : parameters.equals(otherReference.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);  }