2 * Copyright (c) 2015 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
9 package org.opendaylight.yangtools.yang.parser.builder.impl;
11 import com.google.common.base.Optional;
12 import com.google.common.collect.ImmutableList;
13 import com.google.common.collect.ImmutableSet;
14 import java.util.List;
15 import java.util.Objects;
17 import org.opendaylight.yangtools.yang.common.QName;
18 import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
19 import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
20 import org.opendaylight.yangtools.yang.model.api.DerivableSchemaNode;
21 import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
22 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
23 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
24 import org.opendaylight.yangtools.yang.parser.builder.util.AbstractDocumentedDataNodeContainer;
27 * @deprecated Pre-Beryllium implementation, scheduled for removal.
30 final class ListSchemaNodeImpl extends AbstractDocumentedDataNodeContainer implements
31 ListSchemaNode, DerivableSchemaNode {
32 private final QName qname;
33 private final SchemaPath path;
34 ImmutableList<QName> keyDefinition;
37 ListSchemaNode original;
38 boolean configuration;
39 ConstraintDefinition constraints;
40 ImmutableSet<AugmentationSchema> augmentations;
41 ImmutableList<UnknownSchemaNode> unknownNodes;
44 ListSchemaNodeImpl(final QName qname, final SchemaPath path, final ListSchemaNodeBuilder builder) {
51 public QName getQName() {
56 public SchemaPath getPath() {
61 public List<QName> getKeyDefinition() {
66 public boolean isAugmenting() {
71 public boolean isAddedByUses() {
76 public Optional<ListSchemaNode> getOriginal() {
77 return Optional.fromNullable(original);
81 public boolean isConfiguration() {
86 public ConstraintDefinition getConstraints() {
91 public Set<AugmentationSchema> getAvailableAugmentations() {
96 public boolean isUserOrdered() {
101 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
106 public int hashCode() {
107 final int prime = 31;
109 result = prime * result + Objects.hashCode(qname);
110 result = prime * result + Objects.hashCode(path);
115 public boolean equals(final Object obj) {
122 if (getClass() != obj.getClass()) {
125 final ListSchemaNodeImpl other = (ListSchemaNodeImpl) obj;
127 if (other.qname != null) {
130 } else if (!qname.equals(other.qname)) {
134 if (other.path != null) {
137 } else if (!path.equals(other.path)) {
144 public String toString() {
145 return "list " + qname.getLocalName();