2cd8051afb788bb81b2c450474d555b451e4e0ac
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / OutputEffectiveStatementImpl.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.OutputStatement;
18 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
19
20 public final class OutputEffectiveStatementImpl extends AbstractEffectiveContainerSchemaNode<OutputStatement> {
21
22     public OutputEffectiveStatementImpl(
23             final StmtContext<QName, OutputStatement, EffectiveStatement<QName, OutputStatement>> ctx) {
24         super(ctx);
25     }
26
27     @Override
28     public Set<ActionDefinition> getActions() {
29         return ImmutableSet.of();
30     }
31
32     @Override
33     public Set<NotificationDefinition> getNotifications() {
34         return ImmutableSet.of();
35     }
36
37     @Override
38     public int hashCode() {
39         final int prime = 31;
40         int result = 1;
41         result = prime * result + Objects.hashCode(getQName());
42         result = prime * result + Objects.hashCode(getPath());
43         return result;
44     }
45
46     @Override
47     public boolean equals(final Object obj) {
48         if (this == obj) {
49             return true;
50         }
51         if (obj == null) {
52             return false;
53         }
54         if (getClass() != obj.getClass()) {
55             return false;
56         }
57         OutputEffectiveStatementImpl other = (OutputEffectiveStatementImpl) obj;
58         return Objects.equals(getQName(), other.getQName()) && Objects.equals(getPath(), other.getPath());
59     }
60
61     @Override
62     public String toString() {
63         return "RPC Output " + getQName().getLocalName();
64     }
65 }