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.ChoiceCaseNode;
11 import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
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 ChoiceCaseNodeImpl extends AbstractDocumentedDataNodeContainer implements ChoiceCaseNode, DerivableSchemaNode {
18 private final QName qname;
19 private final SchemaPath path;
22 ChoiceCaseNode original;
23 ConstraintDefinition constraints;
24 ImmutableSet<AugmentationSchema> augmentations;
25 ImmutableList<UnknownSchemaNode> unknownNodes;
27 ChoiceCaseNodeImpl(final QName qname, final SchemaPath path,final ChoiceCaseBuilder builder) {
34 public QName getQName() {
39 public SchemaPath getPath() {
44 public boolean isConfiguration() {
49 public ConstraintDefinition getConstraints() {
54 public boolean isAugmenting() {
59 public boolean isAddedByUses() {
64 public Optional<ChoiceCaseNode> getOriginal() {
65 return Optional.fromNullable(original);
69 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
74 public Set<AugmentationSchema> getAvailableAugmentations() {
79 public int hashCode() {
82 result = prime * result + ((qname == null) ? 0 : qname.hashCode());
83 result = prime * result + ((path == null) ? 0 : path.hashCode());
88 public boolean equals(final Object obj) {
95 if (getClass() != obj.getClass()) {
98 ChoiceCaseNodeImpl other = (ChoiceCaseNodeImpl) obj;
100 if (other.qname != null) {
103 } else if (!qname.equals(other.qname)) {
107 if (other.path != null) {
110 } else if (!path.equals(other.path)) {
117 public String toString() {
118 StringBuilder sb = new StringBuilder(ChoiceCaseNodeImpl.class.getSimpleName());
123 return sb.toString();