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;
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<>();
}
@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();