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.ConstraintDefinition;
16 import org.opendaylight.yangtools.yang.model.api.DerivableSchemaNode;
17 import org.opendaylight.yangtools.yang.model.api.LeafListSchemaNode;
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.TypeDefinition;
21 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
24 * @deprecated Pre-Beryllium implementation, scheduled for removal.
27 final class LeafListSchemaNodeImpl implements LeafListSchemaNode, DerivableSchemaNode {
28 private final QName qname;
29 private final SchemaPath path;
35 LeafListSchemaNode original;
36 boolean configuration;
37 ConstraintDefinition constraintsDef;
38 TypeDefinition<?> type;
40 ImmutableList<UnknownSchemaNode> unknownNodes;
42 LeafListSchemaNodeImpl(final QName qname, final SchemaPath path) {
48 public QName getQName() {
53 public SchemaPath getPath() {
58 public String getDescription() {
63 public String getReference() {
68 public Status getStatus() {
73 public boolean isAugmenting() {
78 public boolean isAddedByUses() {
83 public Optional<LeafListSchemaNode> getOriginal() {
84 return Optional.fromNullable(original);
88 public boolean isConfiguration() {
93 public ConstraintDefinition getConstraints() {
94 return constraintsDef;
98 public TypeDefinition<?> getType() {
103 public boolean isUserOrdered() {
108 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
113 public int hashCode() {
114 final int prime = 31;
116 result = prime * result + Objects.hashCode(qname);
117 result = prime * result + Objects.hashCode(path);
122 public boolean equals(final Object obj) {
129 if (getClass() != obj.getClass()) {
132 LeafListSchemaNodeImpl other = (LeafListSchemaNodeImpl) obj;
134 if (other.qname != null) {
137 } else if (!qname.equals(other.qname)) {
141 if (other.path != null) {
144 } else if (!path.equals(other.path)) {
151 public String toString() {
152 StringBuilder sb = new StringBuilder(LeafListSchemaNodeImpl.class.getSimpleName());
156 return sb.toString();