2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.parser.builder.impl;
10 import com.google.common.collect.ImmutableList;
11 import java.util.List;
12 import org.opendaylight.yangtools.yang.common.QName;
13 import org.opendaylight.yangtools.yang.model.api.ExtensionDefinition;
14 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
15 import org.opendaylight.yangtools.yang.model.api.Status;
16 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
18 final class ExtensionDefinitionImpl implements ExtensionDefinition {
19 private final QName qname;
21 private final SchemaPath schemaPath;
25 ImmutableList<UnknownSchemaNode> unknownNodes;
28 ExtensionDefinitionImpl(final QName qname, final SchemaPath path) {
30 this.schemaPath = path;
34 public QName getQName() {
39 public SchemaPath getPath() {
44 public String getDescription() {
49 public String getReference() {
54 public Status getStatus() {
59 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
64 public String getArgument() {
69 public boolean isYinElement() {
74 public int hashCode() {
77 result = prime * result + ((qname == null) ? 0 : qname.hashCode());
78 result = prime * result + ((schemaPath == null) ? 0 : schemaPath.hashCode());
83 public boolean equals(final Object obj) {
90 if (getClass() != obj.getClass()) {
93 ExtensionDefinitionImpl other = (ExtensionDefinitionImpl) obj;
95 if (other.qname != null) {
98 } else if (!qname.equals(other.qname)) {
101 if (schemaPath == null) {
102 if (other.schemaPath != null) {
105 } else if (!schemaPath.equals(other.schemaPath)) {
112 public String toString() {
113 StringBuilder sb = new StringBuilder(ExtensionDefinitionImpl.class.getSimpleName());
115 sb.append("argument=").append(argument);
116 sb.append(", qname=").append(qname);
117 sb.append(", schemaPath=").append(schemaPath);
118 sb.append(", extensionSchemaNodes=").append(unknownNodes);
119 sb.append(", yin=").append(yin);
121 return sb.toString();