f11caa428b173228d3c7655531c1736e8d17803e
[yangtools.git] / yang / yang-parser-rfc7950 / src / main / java / org / opendaylight / yangtools / yang / parser / rfc7950 / stmt / AbstractEffectiveOperationContainerSchemaNode.java
1 /*
2  * Copyright (c) 2018 Pantheon Technologies, s.r.o.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.parser.rfc7950.stmt;
9
10 import com.google.common.base.MoreObjects;
11 import com.google.common.collect.ImmutableSet;
12 import java.util.Objects;
13 import java.util.Set;
14 import org.opendaylight.yangtools.yang.common.QName;
15 import org.opendaylight.yangtools.yang.model.api.ActionDefinition;
16 import org.opendaylight.yangtools.yang.model.api.NotificationDefinition;
17 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
18 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
19
20 @Deprecated(forRemoval = true)
21 public abstract class AbstractEffectiveOperationContainerSchemaNode<D extends DeclaredStatement<QName>>
22         extends AbstractEffectiveContainerSchemaNode<D> {
23     protected AbstractEffectiveOperationContainerSchemaNode(final StmtContext<QName, D, ?> ctx) {
24         super(ctx);
25     }
26
27     @Override
28     public final Set<ActionDefinition> getActions() {
29         return ImmutableSet.of();
30     }
31
32     @Override
33     public final Set<NotificationDefinition> getNotifications() {
34         return ImmutableSet.of();
35     }
36
37     @Override
38     public final boolean isPresenceContainer() {
39         // FIXME: this should not really be here
40         return false;
41     }
42
43     @Override
44     public final int hashCode() {
45         return Objects.hash(getQName(), getPath());
46     }
47
48     @Override
49     public final boolean equals(final Object obj) {
50         if (this == obj) {
51             return true;
52         }
53         if (obj == null || getClass() != obj.getClass()) {
54             return false;
55         }
56         AbstractEffectiveOperationContainerSchemaNode<?> other = (AbstractEffectiveOperationContainerSchemaNode<?>) obj;
57         return Objects.equals(getQName(), other.getQName()) && Objects.equals(getPath(), other.getPath());
58     }
59
60     @Override
61     public final String toString() {
62         return MoreObjects.toStringHelper(this).add("path", getPath()).toString();
63     }
64 }