X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-parser-rfc7950%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fparser%2Frfc7950%2Fstmt%2Fidentity%2FIdentityEffectiveStatementImpl.java;h=23f5472d425832d9c366ef69000f7f783be78533;hb=68e44f106cc8b3ba8e2354f3dfeb3770b868b25a;hp=4b7d8bbf6cb73c484a96d96b8da6847def9e1fc5;hpb=679a3b2027fd416dc3a19ec602dffa42cb680767;p=yangtools.git diff --git a/yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/identity/IdentityEffectiveStatementImpl.java b/yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/identity/IdentityEffectiveStatementImpl.java index 4b7d8bbf6c..23f5472d42 100644 --- a/yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/identity/IdentityEffectiveStatementImpl.java +++ b/yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/identity/IdentityEffectiveStatementImpl.java @@ -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 baseIdentities; private boolean sealed; - IdentityEffectiveStatementImpl( - final StmtContext> ctx) { + IdentityEffectiveStatementImpl(final StmtContext ctx) { super(ctx); this.baseIdentities = new HashSet<>(); @@ -63,40 +61,16 @@ final class IdentityEffectiveStatementImpl extends AbstractEffectiveSchemaNode getBaseIdentities() { + public Collection getBaseIdentities() { checkState(sealed, "Attempt to get base identities from unsealed identity effective statement %s", getQName()); return baseIdentities; } @Override - public Set getDerivedIdentities() { + public Collection 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();