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.ChoiceCaseNode;
20 import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
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 ChoiceCaseNodeImpl extends AbstractDocumentedDataNodeContainer implements ChoiceCaseNode, DerivableSchemaNode {
31 private final QName qname;
32 private final SchemaPath path;
35 ChoiceCaseNode original;
36 ConstraintDefinition constraints;
37 ImmutableSet<AugmentationSchema> augmentations;
38 ImmutableList<UnknownSchemaNode> unknownNodes;
40 ChoiceCaseNodeImpl(final QName qname, final SchemaPath path,final ChoiceCaseBuilder builder) {
47 public QName getQName() {
52 public SchemaPath getPath() {
57 public boolean isConfiguration() {
62 public ConstraintDefinition getConstraints() {
67 public boolean isAugmenting() {
72 public boolean isAddedByUses() {
77 public Optional<ChoiceCaseNode> getOriginal() {
78 return Optional.fromNullable(original);
82 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
87 public Set<AugmentationSchema> getAvailableAugmentations() {
92 public int hashCode() {
95 result = prime * result + Objects.hashCode(qname);
96 result = prime * result + Objects.hashCode(path);
101 public boolean equals(final Object obj) {
108 if (getClass() != obj.getClass()) {
111 ChoiceCaseNodeImpl other = (ChoiceCaseNodeImpl) obj;
113 if (other.qname != null) {
116 } else if (!qname.equals(other.qname)) {
120 if (other.path != null) {
123 } else if (!path.equals(other.path)) {
130 public String toString() {
131 StringBuilder sb = new StringBuilder(ChoiceCaseNodeImpl.class.getSimpleName());
136 return sb.toString();