2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.parser.openconfig.stmt;
10 import java.util.Objects;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yangtools.concepts.SemVer;
13 import org.opendaylight.yangtools.openconfig.model.api.OpenConfigVersionEffectiveStatement;
14 import org.opendaylight.yangtools.openconfig.model.api.OpenConfigVersionStatement;
15 import org.opendaylight.yangtools.yang.common.QName;
16 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
17 import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.UnknownEffectiveStatementBase;
18 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
20 final class OpenConfigVersionEffectiveStatementImpl extends
21 UnknownEffectiveStatementBase<SemVer, OpenConfigVersionStatement>
22 implements OpenConfigVersionEffectiveStatement {
24 private final @NonNull SchemaPath path;
26 OpenConfigVersionEffectiveStatementImpl(final StmtContext<SemVer, OpenConfigVersionStatement, ?> ctx) {
28 path = ctx.coerceParentContext().getSchemaPath().get().createChild(getNodeType());
32 public QName getQName() {
37 public SchemaPath getPath() {
42 public int hashCode() {
43 return Objects.hash(path, getNodeType(), getNodeParameter());
47 public boolean equals(final Object obj) {
51 if (!(obj instanceof OpenConfigVersionEffectiveStatementImpl)) {
54 final OpenConfigVersionEffectiveStatementImpl other = (OpenConfigVersionEffectiveStatementImpl) obj;
55 return Objects.equals(path, other.path) && Objects.equals(getNodeType(), other.getNodeType())
56 && Objects.equals(getNodeParameter(), other.getNodeParameter());