Bug 4412: New yang parser effective statements cleanup
[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 java.util.Objects;
11 import org.opendaylight.yangtools.yang.common.QName;
12 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
13 import org.opendaylight.yangtools.yang.model.api.stmt.InputStatement;
14 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
15
16 public final class InputEffectiveStatementImpl extends AbstractEffectiveContainerSchemaNode<InputStatement> {
17
18     public InputEffectiveStatementImpl(
19             final StmtContext<QName, InputStatement, EffectiveStatement<QName, InputStatement>> ctx) {
20         super(ctx);
21     }
22
23     @Override
24     public int hashCode() {
25         final int prime = 31;
26         int result = 1;
27         result = prime * result + Objects.hashCode(getQName());
28         result = prime * result + Objects.hashCode(getPath());
29         return result;
30     }
31
32     @Override
33     public boolean equals(final Object obj) {
34         if (this == obj) {
35             return true;
36         }
37         if (obj == null) {
38             return false;
39         }
40         if (getClass() != obj.getClass()) {
41             return false;
42         }
43         InputEffectiveStatementImpl other = (InputEffectiveStatementImpl) obj;
44         return Objects.equals(getQName(), other.getQName()) && Objects.equals(getPath(), other.getPath());
45     }
46
47     @Override
48     public String toString() {
49         return "RPC input " + getQName().getLocalName();
50     }
51 }