2 * Copyright (c) 2020 PANTHEON.tech, s.r.o. 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.restconf.nb.rfc8040.rests.services.impl;
10 import static com.google.common.base.Verify.verify;
12 import com.google.common.collect.ImmutableMap;
15 import java.util.function.Function;
16 import org.opendaylight.yangtools.yang.common.QNameModule;
17 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
18 import org.opendaylight.yangtools.yang.model.api.Module;
19 import org.opendaylight.yangtools.yang.model.api.stmt.ModuleEffectiveStatement;
20 import org.opendaylight.yangtools.yang.model.spi.SimpleSchemaContext;
22 @Deprecated(forRemoval = true, since = "4.0.0")
23 final class OperationsEffectiveModuleContext extends SimpleSchemaContext implements EffectiveModelContext {
24 private final ImmutableMap<QNameModule, ModuleEffectiveStatement> modules;
26 OperationsEffectiveModuleContext(final Set<Module> modules) {
28 this.modules = modules.stream()
30 verify(module instanceof ModuleEffectiveStatement, "Module %s is not an effective statement");
31 return (ModuleEffectiveStatement) module;
33 .collect(ImmutableMap.toImmutableMap(ModuleEffectiveStatement::localQNameModule, Function.identity()));
37 public Map<QNameModule, ModuleEffectiveStatement> getModuleStatements() {