YANGTOOLS-706: Retrofit EffectiveStatement interfaces into parser
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / InputEffectiveStatementImpl.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  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.stmt.rfc6020.effective;
9
10 import com.google.common.collect.ImmutableSet;
11 import java.util.Objects;
12 import java.util.Set;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.model.api.ActionDefinition;
15 import org.opendaylight.yangtools.yang.model.api.NotificationDefinition;
16 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
17 import org.opendaylight.yangtools.yang.model.api.stmt.InputEffectiveStatement;
18 import org.opendaylight.yangtools.yang.model.api.stmt.InputStatement;
19 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
20
21 public final class InputEffectiveStatementImpl extends AbstractEffectiveContainerSchemaNode<InputStatement>
22         implements InputEffectiveStatement {
23
24     public InputEffectiveStatementImpl(
25             final StmtContext<QName, InputStatement, EffectiveStatement<QName, InputStatement>> ctx) {
26         super(ctx);
27     }
28
29     @Override
30     public Set<ActionDefinition> getActions() {
31         return ImmutableSet.of();
32     }
33
34     @Override
35     public Set<NotificationDefinition> getNotifications() {
36         return ImmutableSet.of();
37     }
38
39     @Override
40     public int hashCode() {
41         final int prime = 31;
42         int result = 1;
43         result = prime * result + Objects.hashCode(getQName());
44         result = prime * result + Objects.hashCode(getPath());
45         return result;
46     }
47
48     @Override
49     public boolean equals(final Object obj) {
50         if (this == obj) {
51             return true;
52         }
53         if (obj == null) {
54             return false;
55         }
56         if (getClass() != obj.getClass()) {
57             return false;
58         }
59         InputEffectiveStatementImpl other = (InputEffectiveStatementImpl) obj;
60         return Objects.equals(getQName(), other.getQName()) && Objects.equals(getPath(), other.getPath());
61     }
62
63     @Override
64     public String toString() {
65         return "RPC input " + getQName().getLocalName();
66     }
67 }