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.base.Optional;
11 import com.google.common.collect.ImmutableList;
12 import java.util.List;
13 import java.util.Objects;
14 import org.opendaylight.yangtools.yang.common.QName;
15 import org.opendaylight.yangtools.yang.model.api.AnyXmlSchemaNode;
16 import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
17 import org.opendaylight.yangtools.yang.model.api.DerivableSchemaNode;
18 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
19 import org.opendaylight.yangtools.yang.model.api.Status;
20 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
24 * @deprecated Pre-Beryllium implementation, scheduled for removal.
27 final class AnyXmlSchemaNodeImpl implements AnyXmlSchemaNode, DerivableSchemaNode {
28 private final QName qname;
29 private final SchemaPath path;
33 boolean configuration;
34 AnyXmlSchemaNode original;
35 ConstraintDefinition constraintsDef;
38 ImmutableList<UnknownSchemaNode> unknownNodes;
40 AnyXmlSchemaNodeImpl(final QName qname, final SchemaPath path) {
46 public QName getQName() {
51 public SchemaPath getPath() {
56 public String getDescription() {
61 public String getReference() {
66 public Status getStatus() {
71 public boolean isAugmenting() {
76 public boolean isAddedByUses() {
81 public Optional<AnyXmlSchemaNode> getOriginal() {
82 return Optional.fromNullable(original);
86 public boolean isConfiguration() {
91 public ConstraintDefinition getConstraints() {
92 return constraintsDef;
96 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
101 public int hashCode() {
102 final int prime = 31;
104 result = prime * result + Objects.hashCode(qname);
105 result = prime * result + Objects.hashCode(path);
110 public boolean equals(final Object obj) {
117 if (getClass() != obj.getClass()) {
120 AnyXmlSchemaNodeImpl other = (AnyXmlSchemaNodeImpl) obj;
122 if (other.qname != null) {
125 } else if (!qname.equals(other.qname)) {
129 if (other.path != null) {
132 } else if (!path.equals(other.path)) {
139 public String toString() {
140 StringBuilder sb = new StringBuilder(AnyXmlSchemaNodeImpl.class.getSimpleName());
142 sb.append("qname=").append(qname);
143 sb.append(", path=").append(path);
145 return sb.toString();