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.netconf.client.mdsal.impl;
10 import com.google.common.collect.ImmutableMap;
11 import com.google.common.collect.Maps;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.yangtools.concepts.Immutable;
14 import org.opendaylight.yangtools.yang.common.QName;
15 import org.opendaylight.yangtools.yang.data.api.schema.MountPointContext;
16 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
17 import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
19 public final class BaseSchema implements Immutable {
20 private final @NonNull ImmutableMap<QName, ? extends RpcDefinition> mappedRpcs;
21 private final @NonNull MountPointContext mountContext;
23 BaseSchema(final EffectiveModelContext context) {
24 mountContext = MountPointContext.of(context);
25 mappedRpcs = Maps.uniqueIndex(context.getOperations(), RpcDefinition::getQName);
28 public @NonNull EffectiveModelContext modelContext() {
29 return mountContext.modelContext();
32 @NonNull ImmutableMap<QName, ? extends RpcDefinition> getMappedRpcs() {
36 public @NonNull MountPointContext getMountPointContext() {