1 package org.opendaylight.yangtools.yang.parser.builder.impl;
3 import com.google.common.base.Optional;
4 import com.google.common.collect.ImmutableList;
5 import com.google.common.collect.ImmutableSet;
8 import org.opendaylight.yangtools.yang.common.QName;
9 import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
10 import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
11 import org.opendaylight.yangtools.yang.model.api.DerivableSchemaNode;
12 import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
13 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
14 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
15 import org.opendaylight.yangtools.yang.parser.builder.util.AbstractDocumentedDataNodeContainer;
17 final class ListSchemaNodeImpl extends AbstractDocumentedDataNodeContainer implements
18 ListSchemaNode, DerivableSchemaNode {
19 private final QName qname;
20 private final SchemaPath path;
21 ImmutableList<QName> keyDefinition;
24 ListSchemaNode original;
25 boolean configuration;
26 ConstraintDefinition constraints;
27 ImmutableSet<AugmentationSchema> augmentations;
28 ImmutableList<UnknownSchemaNode> unknownNodes;
31 ListSchemaNodeImpl(final QName qname, final SchemaPath path, final ListSchemaNodeBuilder builder) {
38 public QName getQName() {
43 public SchemaPath getPath() {
48 public List<QName> getKeyDefinition() {
53 public boolean isAugmenting() {
58 public boolean isAddedByUses() {
63 public Optional<ListSchemaNode> getOriginal() {
64 return Optional.fromNullable(original);
68 public boolean isConfiguration() {
73 public ConstraintDefinition getConstraints() {
78 public Set<AugmentationSchema> getAvailableAugmentations() {
83 public boolean isUserOrdered() {
88 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
93 public int hashCode() {
96 result = prime * result + ((qname == null) ? 0 : qname.hashCode());
97 result = prime * result + ((path == null) ? 0 : path.hashCode());
102 public boolean equals(final Object obj) {
109 if (getClass() != obj.getClass()) {
112 final ListSchemaNodeImpl other = (ListSchemaNodeImpl) obj;
114 if (other.qname != null) {
117 } else if (!qname.equals(other.qname)) {
121 if (other.path != null) {
124 } else if (!path.equals(other.path)) {
131 public String toString() {
132 return "list " + qname.getLocalName();