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.ContainerSchemaNode;
21 import org.opendaylight.yangtools.yang.model.api.DerivableSchemaNode;
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 ContainerSchemaNodeImpl extends AbstractDocumentedDataNodeContainer implements
31 ContainerSchemaNode, DerivableSchemaNode {
32 private final QName qname;
33 private final SchemaPath path;
37 boolean configuration;
38 ContainerSchemaNode original;
39 ConstraintDefinition constraints;
41 ImmutableSet<AugmentationSchema> augmentations;
42 ImmutableList<UnknownSchemaNode> unknownNodes;
46 public ContainerSchemaNodeImpl(final ContainerSchemaNodeBuilder builder) {
48 this.qname = builder.getQName();
49 this.path = builder.getPath();
53 public QName getQName() {
58 public SchemaPath getPath() {
63 public boolean isAugmenting() {
68 public boolean isAddedByUses() {
73 public Optional<ContainerSchemaNode> getOriginal() {
74 return Optional.fromNullable(original);
78 public boolean isConfiguration() {
83 public ConstraintDefinition getConstraints() {
88 public Set<AugmentationSchema> getAvailableAugmentations() {
93 public boolean isPresenceContainer() {
98 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
103 public int hashCode() {
104 final int prime = 31;
106 result = prime * result + Objects.hashCode(qname);
107 result = prime * result + Objects.hashCode(path);
112 public boolean equals(final Object obj) {
119 if (getClass() != obj.getClass()) {
122 ContainerSchemaNodeImpl other = (ContainerSchemaNodeImpl) obj;
124 if (other.qname != null) {
127 } else if (!qname.equals(other.qname)) {
131 if (other.path != null) {
134 } else if (!path.equals(other.path)) {
141 public String toString() {
142 return "container " + qname.getLocalName();