Remove hashCode()/equals() from SchemaNode implementations
[yangtools.git] / yang / yang-parser-rfc7950 / src / test / java / org / opendaylight / yangtools / yang / thirdparty / plugin / ThirdPartyExtensionEffectiveStatementImpl.java
1 /*
2  * Copyright (c) 2016 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.thirdparty.plugin;
9
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.yangtools.yang.common.QName;
12 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
13 import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.UnknownEffectiveStatementBase;
14 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
15
16 final class ThirdPartyExtensionEffectiveStatementImpl
17         extends UnknownEffectiveStatementBase<String, ThirdPartyExtensionStatement>
18         implements ThirdPartyExtensionEffectiveStatement {
19
20     private final @NonNull SchemaPath path;
21     private final String valueFromNamespace;
22
23     ThirdPartyExtensionEffectiveStatementImpl(final StmtContext<String, ThirdPartyExtensionStatement, ?> ctx) {
24         super(ctx);
25         path = ctx.coerceParentContext().getSchemaPath().get().createChild(getNodeType());
26         valueFromNamespace = ctx.getFromNamespace(ThirdPartyNamespace.class, ctx);
27     }
28
29     @Override
30     public String getValueFromNamespace() {
31         return valueFromNamespace;
32     }
33
34     @Override
35     public QName getQName() {
36         return getNodeType();
37     }
38
39     @Override
40     public SchemaPath getPath() {
41         return path;
42     }
43 }