package org.opendaylight.yangtools.yang.parser.builder.impl; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import java.util.List; import java.util.Set; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.model.api.AugmentationSchema; import org.opendaylight.yangtools.yang.model.api.NotificationDefinition; import org.opendaylight.yangtools.yang.model.api.SchemaPath; import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode; import org.opendaylight.yangtools.yang.parser.builder.util.AbstractDocumentedDataNodeContainer; final class NotificationDefinitionImpl extends AbstractDocumentedDataNodeContainer implements NotificationDefinition { private final QName qname; private final SchemaPath path; ImmutableSet augmentations; ImmutableList unknownNodes; NotificationDefinitionImpl(final QName qname, final SchemaPath path, final NotificationBuilder builder) { super(builder); // TODO Auto-generated constructor stub this.qname = qname; this.path = path; } @Override public QName getQName() { return qname; } @Override public SchemaPath getPath() { return path; } @Override public Set getAvailableAugmentations() { return augmentations; } @Override public List getUnknownSchemaNodes() { return unknownNodes; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((qname == null) ? 0 : qname.hashCode()); result = prime * result + ((path == null) ? 0 : path.hashCode()); 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 NotificationDefinitionImpl other = (NotificationDefinitionImpl) obj; if (qname == null) { if (other.qname != null) { return false; } } else if (!qname.equals(other.qname)) { return false; } if (path == null) { if (other.path != null) { return false; } } else if (!path.equals(other.path)) { return false; } return true; } @Override public String toString() { StringBuilder sb = new StringBuilder(NotificationDefinitionImpl.class.getSimpleName()); sb.append("[qname=").append(qname).append(", path=").append(path).append("]"); return sb.toString(); } }