cc41b9a5c42f52ee9ed787a3d70ad05f1c473ca6
[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.OutputEffectiveStatement;
18 import org.opendaylight.yangtools.yang.model.api.stmt.OutputStatement;
19 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
20
21 public final class OutputEffectiveStatementImpl extends AbstractEffectiveContainerSchemaNode<OutputStatement>
22         implements OutputEffectiveStatement {
23
24     public OutputEffectiveStatementImpl(
25             final StmtContext<QName, OutputStatement, EffectiveStatement<QName, OutputStatement>> 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 boolean isPresenceContainer() {
41         // FIXME: this should not really be here
42         return false;
43     }
44
45     @Override
46     public int hashCode() {
47         final int prime = 31;
48         int result = 1;
49         result = prime * result + Objects.hashCode(getQName());
50         result = prime * result + Objects.hashCode(getPath());
51         return result;
52     }
53
54     @Override
55     public boolean equals(final Object obj) {
56         if (this == obj) {
57             return true;
58         }
59         if (obj == null) {
60             return false;
61         }
62         if (getClass() != obj.getClass()) {
63             return false;
64         }
65         OutputEffectiveStatementImpl other = (OutputEffectiveStatementImpl) obj;
66         return Objects.equals(getQName(), other.getQName()) && Objects.equals(getPath(), other.getPath());
67     }
68
69     @Override
70     public String toString() {
71         return "RPC Output " + getQName().getLocalName();
72     }
73 }