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;
20 * @deprecated Pre-Beryllium implementation, scheduled for removal.
23 final class ExtensionDefinitionImpl implements ExtensionDefinition {
24 private final QName qname;
26 private final SchemaPath schemaPath;
30 ImmutableList<UnknownSchemaNode> unknownNodes;
33 ExtensionDefinitionImpl(final QName qname, final SchemaPath path) {
35 this.schemaPath = path;
39 public QName getQName() {
44 public SchemaPath getPath() {
49 public String getDescription() {
54 public String getReference() {
59 public Status getStatus() {
64 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
69 public String getArgument() {
74 public boolean isYinElement() {
79 public int hashCode() {
82 result = prime * result + Objects.hashCode(qname);
83 result = prime * result + Objects.hashCode(schemaPath);
88 public boolean equals(final Object obj) {
95 if (getClass() != obj.getClass()) {
98 ExtensionDefinitionImpl other = (ExtensionDefinitionImpl) obj;
100 if (other.qname != null) {
103 } else if (!qname.equals(other.qname)) {
106 if (schemaPath == null) {
107 if (other.schemaPath != null) {
110 } else if (!schemaPath.equals(other.schemaPath)) {
117 public String toString() {
118 StringBuilder sb = new StringBuilder(ExtensionDefinitionImpl.class.getSimpleName());
120 sb.append("argument=").append(argument);
121 sb.append(", qname=").append(qname);
122 sb.append(", schemaPath=").append(schemaPath);
123 sb.append(", extensionSchemaNodes=").append(unknownNodes);
124 sb.append(", yin=").append(yin);
126 return sb.toString();