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