Adjust test suite parser update to conform with API changes
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / rfc7950 / stmt / feature / FeatureEffectiveStatementImpl.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.feature;
9
10 import java.util.Objects;
11 import org.opendaylight.yangtools.yang.common.QName;
12 import org.opendaylight.yangtools.yang.model.api.FeatureDefinition;
13 import org.opendaylight.yangtools.yang.model.api.stmt.FeatureEffectiveStatement;
14 import org.opendaylight.yangtools.yang.model.api.stmt.FeatureStatement;
15 import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractEffectiveSchemaNode;
16 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
17
18 final class FeatureEffectiveStatementImpl extends AbstractEffectiveSchemaNode<FeatureStatement>
19         implements FeatureDefinition, FeatureEffectiveStatement {
20
21     FeatureEffectiveStatementImpl(final StmtContext<QName, FeatureStatement, ?> ctx) {
22         super(ctx);
23     }
24
25     @Override
26     public int hashCode() {
27         final int prime = 31;
28         int result = 1;
29         result = prime * result + Objects.hashCode(getQName());
30         result = prime * result + Objects.hashCode(getPath());
31         return result;
32     }
33
34     @Override
35     public boolean equals(final Object obj) {
36         if (this == obj) {
37             return true;
38         }
39         if (obj == null) {
40             return false;
41         }
42         if (getClass() != obj.getClass()) {
43             return false;
44         }
45         FeatureEffectiveStatementImpl other = (FeatureEffectiveStatementImpl) obj;
46         return Objects.equals(getQName(), other.getQName()) && Objects.equals(getPath(), other.getPath());
47     }
48
49     @Override
50     public String toString() {
51         return FeatureEffectiveStatementImpl.class.getSimpleName() + "[name=" + getQName() + "]";
52     }
53 }