Remove hashCode()/equals() from SchemaNode implementations
[yangtools.git] / yang / odlext-parser-support / src / main / java / org / opendaylight / yangtools / odlext / parser / AnyxmlSchemaLocationEffectiveStatementImpl.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.odlext.parser;
9
10 import com.google.common.annotations.VisibleForTesting;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yangtools.odlext.model.api.AnyxmlSchemaLocationEffectiveStatement;
13 import org.opendaylight.yangtools.odlext.model.api.AnyxmlSchemaLocationStatement;
14 import org.opendaylight.yangtools.yang.common.QName;
15 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
16 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier;
17 import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.UnknownEffectiveStatementBase;
18 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
19
20 @VisibleForTesting
21 public final class AnyxmlSchemaLocationEffectiveStatementImpl
22         extends UnknownEffectiveStatementBase<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement>
23         implements AnyxmlSchemaLocationEffectiveStatement {
24
25     private final @NonNull SchemaPath path;
26
27     AnyxmlSchemaLocationEffectiveStatementImpl(
28             final StmtContext<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement, ?> ctx) {
29         super(ctx);
30         path = ctx.coerceParentContext().getSchemaPath().get().createChild(getNodeType());
31     }
32
33     @Override
34     public @NonNull QName getQName() {
35         return getNodeType();
36     }
37
38     @Override
39     public @NonNull SchemaPath getPath() {
40         return path;
41     }
42 }