/*
 * Entity.java
 *
 */

package de.uni_stuttgart.vis.vowl.owl2vowl.model;

import com.google.common.collect.ImmutableSet;
import com.sun.javafx.collections.UnmodifiableListSet;
import de.uni_stuttgart.vis.vowl.owl2vowl.export.JsonGeneratorVisitor;
import org.semanticweb.owlapi.model.IRI;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/**
 *
 */
public abstract class AbstractEntity implements HasEquivalents {

	private IRI iri;
	private String type;
	private Set<IRI> equivalents = new HashSet<>();

	protected AbstractEntity(IRI iri, String type) {
		this.iri = iri;
		this.type = type;
	}

	public String getType() {
		return type;
	}

	public IRI getIri() {
		return iri;
	}

	public void accept(JsonGeneratorVisitor visitor) {
		visitor.visit(this);
	}

	@Override
	public Set<IRI> getEquivalentsIris() {
		return Collections.unmodifiableSet(equivalents);
	}

	public void addEquivalentIri(IRI iri) {
		equivalents.add(iri);
	}

	@Override
	public String toString() {
		return iri.toString();
	}
}

@@ -74,110 +74,8 @@
 l;%0A%0A
-import com.google.common.collect.ImmutableSet;%0Aimport com.sun.javafx.collections.UnmodifiableListSet;%0A
 impo
@@ -928,11 +928,350 @@
 ng();%0A%09%7D
+%0A%0A%09@Override%0A%09public boolean equals(Object o) %7B%0A%09%09if (this == o) return true;%0A%09%09if (o == null %7C%7C getClass() != o.getClass()) return false;%0A%0A%09%09AbstractEntity that = (AbstractEntity) o;%0A%0A%09%09return !(iri != null ? !iri.equals(that.iri) : that.iri != null);%0A%0A%09%7D%0A%0A%09@Override%0A%09public int hashCode() %7B%0A%09%09return iri != null ? iri.hashCode() : 0;%0A%09%7D
 %0A%7D%0A

Change hashCode and equals