2 * Copyright (c) 2013, 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
8 package org.opendaylight.yangtools.yang.parser.builder.impl;
10 import com.google.common.collect.ImmutableList;
11 import com.google.common.collect.ImmutableMap;
12 import com.google.common.collect.ImmutableSet;
13 import java.util.List;
15 import java.util.Objects;
17 import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
18 import org.opendaylight.yangtools.yang.model.api.SchemaNode;
19 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
20 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
21 import org.opendaylight.yangtools.yang.model.api.UsesNode;
24 * @deprecated Pre-Beryllium implementation, scheduled for removal.
27 final class UsesNodeImpl implements UsesNode {
28 private final SchemaPath groupingPath;
29 ImmutableSet<AugmentationSchema> augmentations;
30 private boolean addedByUses;
31 ImmutableMap<SchemaPath, SchemaNode> refines;
32 ImmutableList<UnknownSchemaNode> unknownNodes;
34 UsesNodeImpl(final SchemaPath groupingPath) {
35 this.groupingPath = groupingPath;
39 public SchemaPath getGroupingPath() {
44 public Set<AugmentationSchema> getAugmentations() {
49 public boolean isAugmenting() {
54 public boolean isAddedByUses() {
58 void setAddedByUses(final boolean addedByUses) {
59 this.addedByUses = addedByUses;
63 public Map<SchemaPath, SchemaNode> getRefines() {
67 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
72 public int hashCode() {
75 result = prime * result + Objects.hashCode(groupingPath);
76 result = prime * result + Objects.hashCode(augmentations);
81 public boolean equals(final Object obj) {
88 if (getClass() != obj.getClass()) {
91 final UsesNodeImpl other = (UsesNodeImpl) obj;
92 if (groupingPath == null) {
93 if (other.groupingPath != null) {
96 } else if (!groupingPath.equals(other.groupingPath)) {
99 if (augmentations == null) {
100 if (other.augmentations != null) {
103 } else if (!augmentations.equals(other.augmentations)) {
110 public String toString() {
111 StringBuilder sb = new StringBuilder(UsesNodeImpl.class.getSimpleName());
112 sb.append("[groupingPath=");
113 sb.append(groupingPath);
115 return sb.toString();