1 package org.opendaylight.yangtools.yang.parser.builder.impl;
3 import com.google.common.collect.ImmutableList;
4 import java.util.Collections;
7 import org.opendaylight.yangtools.yang.common.QName;
8 import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode;
9 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
10 import org.opendaylight.yangtools.yang.model.api.Status;
11 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
13 final class IdentitySchemaNodeImpl implements IdentitySchemaNode {
14 private final QName qname;
15 private final SchemaPath path;
16 IdentitySchemaNode baseIdentity;
17 private final Set<IdentitySchemaNode> derivedIdentities;
21 ImmutableList<UnknownSchemaNode> unknownNodes;
23 IdentitySchemaNodeImpl(final QName qname, final SchemaPath path,
24 final Set<IdentitySchemaNode> derivedIdentities) {
27 this.derivedIdentities = derivedIdentities;
31 public QName getQName() {
36 public IdentitySchemaNode getBaseIdentity() {
41 public Set<IdentitySchemaNode> getDerivedIdentities() {
42 return Collections.unmodifiableSet(derivedIdentities);
46 public String getDescription() {
51 public String getReference() {
56 public Status getStatus() {
61 public SchemaPath getPath() {
66 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
71 public int hashCode() {
74 result = prime * result + ((qname == null) ? 0 : qname.hashCode());
75 result = prime * result + ((path == null) ? 0 : path.hashCode());
80 public boolean equals(final Object obj) {
87 if (getClass() != obj.getClass()) {
90 IdentitySchemaNodeImpl other = (IdentitySchemaNodeImpl) obj;
92 if (other.qname != null) {
95 } else if (!qname.equals(other.qname)) {
99 if (other.path != null) {
102 } else if (!path.equals(other.path)) {
109 public String toString() {
110 StringBuilder sb = new StringBuilder(IdentitySchemaNodeImpl.class.getSimpleName());
112 sb.append("base=").append(baseIdentity);
113 sb.append(", qname=").append(qname);
115 return sb.toString();