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.ContainerSchemaNode;
12 import org.opendaylight.yangtools.yang.model.api.DerivableSchemaNode;
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 ContainerSchemaNodeImpl extends AbstractDocumentedDataNodeContainer implements
18 ContainerSchemaNode, DerivableSchemaNode {
19 private final QName qname;
20 private final SchemaPath path;
24 boolean configuration;
25 ContainerSchemaNode original;
26 ConstraintDefinition constraints;
28 ImmutableSet<AugmentationSchema> augmentations;
29 ImmutableList<UnknownSchemaNode> unknownNodes;
33 public ContainerSchemaNodeImpl(final ContainerSchemaNodeBuilder builder) {
35 this.qname = builder.getQName();
36 this.path = builder.getPath();
40 public QName getQName() {
45 public SchemaPath getPath() {
50 public boolean isAugmenting() {
55 public boolean isAddedByUses() {
60 public Optional<ContainerSchemaNode> getOriginal() {
61 return Optional.fromNullable(original);
65 public boolean isConfiguration() {
70 public ConstraintDefinition getConstraints() {
75 public Set<AugmentationSchema> getAvailableAugmentations() {
80 public boolean isPresenceContainer() {
85 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
90 public int hashCode() {
93 result = prime * result + ((qname == null) ? 0 : qname.hashCode());
94 result = prime * result + ((path == null) ? 0 : path.hashCode());
99 public boolean equals(final Object obj) {
106 if (getClass() != obj.getClass()) {
109 ContainerSchemaNodeImpl other = (ContainerSchemaNodeImpl) obj;
111 if (other.qname != null) {
114 } else if (!qname.equals(other.qname)) {
118 if (other.path != null) {
121 } else if (!path.equals(other.path)) {
128 public String toString() {
129 return "container " + qname.getLocalName();