public boolean equals()

in taverna-scufl2-api/src/main/java/org/apache/taverna/scufl2/api/common/AbstractNamed.java [103:130]


	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		AbstractNamed other = (AbstractNamed) obj;
		if (!getName().equals(other.getName()))
			return false;
		if (this instanceof Child) {
			WorkflowBean parent = ((Child<?>) this).getParent();
			WorkflowBean otherParent = ((Child<?>) other).getParent();
			if (parent != null)
				return parent.equals(otherParent);
			if (parent == null && otherParent != null)
				return false;
		}
		if (this instanceof Typed) {
			URI myId = ((Typed) this).getType();
			URI otherId = ((Typed) obj).getType();
			if (myId != null)
				return myId.equals(otherId);
			if (myId == null && otherId != null)
				return false;
		}
		return true;
	}