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 java.util.Objects;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.model.api.ExtensionDefinition;
15 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
16 import org.opendaylight.yangtools.yang.model.api.Status;
17 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
19 final class ExtensionDefinitionImpl implements ExtensionDefinition {
20 private final QName qname;
22 private final SchemaPath schemaPath;
26 ImmutableList<UnknownSchemaNode> unknownNodes;
29 ExtensionDefinitionImpl(final QName qname, final SchemaPath path) {
31 this.schemaPath = path;
35 public QName getQName() {
40 public SchemaPath getPath() {
45 public String getDescription() {
50 public String getReference() {
55 public Status getStatus() {
60 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
65 public String getArgument() {
70 public boolean isYinElement() {
75 public int hashCode() {
78 result = prime * result + Objects.hashCode(qname);
79 result = prime * result + Objects.hashCode(schemaPath);
84 public boolean equals(final Object obj) {
91 if (getClass() != obj.getClass()) {
94 ExtensionDefinitionImpl other = (ExtensionDefinitionImpl) obj;
96 if (other.qname != null) {
99 } else if (!qname.equals(other.qname)) {
102 if (schemaPath == null) {
103 if (other.schemaPath != null) {
106 } else if (!schemaPath.equals(other.schemaPath)) {
113 public String toString() {
114 StringBuilder sb = new StringBuilder(ExtensionDefinitionImpl.class.getSimpleName());
116 sb.append("argument=").append(argument);
117 sb.append(", qname=").append(qname);
118 sb.append(", schemaPath=").append(schemaPath);
119 sb.append(", extensionSchemaNodes=").append(unknownNodes);
120 sb.append(", yin=").append(yin);
122 return sb.toString();