2 * Copyright (c) 2015 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.stmt.rfc6020.effective;
10 import com.google.common.base.Verify;
11 import java.util.Objects;
12 import org.opendaylight.yangtools.yang.common.QNameModule;
13 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
14 import org.opendaylight.yangtools.yang.model.api.stmt.ModuleEffectiveStatement;
15 import org.opendaylight.yangtools.yang.model.api.stmt.ModuleStatement;
16 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
17 import org.opendaylight.yangtools.yang.parser.spi.source.ModuleCtxToModuleQName;
19 public final class ModuleEffectiveStatementImpl extends AbstractEffectiveModule<ModuleStatement>
20 implements ModuleEffectiveStatement {
21 private final QNameModule qnameModule;
23 public ModuleEffectiveStatementImpl(
24 final StmtContext<String, ModuleStatement, EffectiveStatement<String, ModuleStatement>> ctx) {
27 qnameModule = Verify.verifyNotNull(ctx.getFromNamespace(ModuleCtxToModuleQName.class, ctx));
31 public QNameModule getQNameModule() {
36 public int hashCode() {
39 result = prime * result + Objects.hashCode(getName());
40 result = prime * result + Objects.hashCode(getYangVersion());
41 result = prime * result + Objects.hashCode(qnameModule);
46 public boolean equals(final Object obj) {
50 if (!(obj instanceof ModuleEffectiveStatementImpl)) {
53 ModuleEffectiveStatementImpl other = (ModuleEffectiveStatementImpl) obj;
54 if (!Objects.equals(getName(), other.getName())) {
57 if (!qnameModule.equals(other.qnameModule)) {
60 if (!Objects.equals(getYangVersion(), other.getYangVersion())) {