class EntityReference implements Serializable, Cloneable, Comparable<EntityReference> {

    @Override
    public boolean equals(Object obj)
    {
        boolean equals = false;

        if (obj == this) {
            equals = true;
        } else if (obj instanceof EntityReference) {
            EntityReference entityReference = (EntityReference) obj;

            equals =
                (entityReference.getName() == null ? getName() == null : entityReference.getName().equals(getName()))
                    && (entityReference.getParent() == null ? getParent() == null : entityReference.getParent().equals(
                        getParent()))
                    && (entityReference.getType() == null ? getType() == null : entityReference.getType().equals(
                        getType())); 
        }

        return equals;
    }

    public  EntityReference(String name, EntityType type);
    public  EntityReference(String name, EntityType type, EntityReference parent);

}