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.restconf.nb.rfc8040.services.simple.impl;
10 import static java.util.Objects.requireNonNull;
12 import java.util.Optional;
13 import org.opendaylight.yangtools.concepts.SemVer;
14 import org.opendaylight.yangtools.yang.common.Revision;
15 import org.opendaylight.yangtools.yang.model.api.Module;
16 import org.opendaylight.yangtools.yang.model.api.ModuleImport;
19 * Fake {@link ModuleImport} implementation used to attach corrent prefix mapping to fake RPCs.
21 * @author Robert Varga
23 final class FakeModuleImport implements ModuleImport {
24 private final Module module;
26 FakeModuleImport(final Module module) {
27 this.module = requireNonNull(module);
31 public String getModuleName() {
32 return module.getName();
36 public Optional<Revision> getRevision() {
37 return module.getRevision();
41 public String getPrefix() {
42 return module.getName();
46 public Optional<String> getDescription() {
47 return module.getDescription();
51 public Optional<String> getReference() {
52 return module.getReference();
56 public Optional<SemVer> getSemanticVersion() {
57 return module.getSemanticVersion();