Remove hashCode()/equals() from SchemaNode implementations
[yangtools.git] / yang / yang-parser-rfc7950 / src / main / java / org / opendaylight / yangtools / yang / parser / rfc7950 / stmt / identity / IdentityEffectiveStatementImpl.java
index 4b7d8bbf6cb73c484a96d96b8da6847def9e1fc5..23f5472d425832d9c366ef69000f7f783be78533 100644 (file)
@@ -11,15 +11,14 @@ import static com.google.common.base.Preconditions.checkState;
 
 import com.google.common.base.MoreObjects;
 import com.google.common.collect.ImmutableSet;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
-import java.util.Objects;
 import java.util.Set;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.IdentityEffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.IdentityStatement;
 import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractEffectiveSchemaNode;
@@ -33,8 +32,7 @@ final class IdentityEffectiveStatementImpl extends AbstractEffectiveSchemaNode<I
     private @NonNull Set<IdentitySchemaNode> baseIdentities;
     private boolean sealed;
 
-    IdentityEffectiveStatementImpl(
-            final StmtContext<QName, IdentityStatement, EffectiveStatement<QName, IdentityStatement>> ctx) {
+    IdentityEffectiveStatementImpl(final StmtContext<QName, IdentityStatement, IdentityEffectiveStatement> ctx) {
         super(ctx);
 
         this.baseIdentities = new HashSet<>();
@@ -63,40 +61,16 @@ final class IdentityEffectiveStatementImpl extends AbstractEffectiveSchemaNode<I
     }
 
     @Override
-    public Set<IdentitySchemaNode> getBaseIdentities() {
+    public Collection<? extends IdentitySchemaNode> getBaseIdentities() {
         checkState(sealed, "Attempt to get base identities from unsealed identity effective statement %s", getQName());
         return baseIdentities;
     }
 
     @Override
-    public Set<IdentitySchemaNode> getDerivedIdentities() {
+    public Collection<? extends IdentitySchemaNode> getDerivedIdentities() {
         return Collections.unmodifiableSet(derivedIdentities);
     }
 
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + Objects.hashCode(getQName());
-        result = prime * result + Objects.hashCode(getPath());
-        return result;
-    }
-
-    @Override
-    public boolean equals(final Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        final IdentityEffectiveStatementImpl other = (IdentityEffectiveStatementImpl) obj;
-        return Objects.equals(getQName(), other.getQName()) && Objects.equals(getPath(), other.getPath());
-    }
-
     @Override
     public String toString() {
         return MoreObjects.toStringHelper(this).add("qname", getQName()).add("path", getPath()).toString();