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.base.services.impl;
10 import com.google.common.base.Preconditions;
11 import com.google.common.collect.ForwardingObject;
12 import com.google.common.collect.ImmutableList;
13 import com.google.common.collect.ImmutableSet;
15 import java.util.Collection;
16 import java.util.Date;
17 import java.util.List;
19 import org.opendaylight.yangtools.yang.common.QName;
20 import org.opendaylight.yangtools.yang.common.QNameModule;
21 import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
22 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
23 import org.opendaylight.yangtools.yang.model.api.Deviation;
24 import org.opendaylight.yangtools.yang.model.api.ExtensionDefinition;
25 import org.opendaylight.yangtools.yang.model.api.FeatureDefinition;
26 import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
27 import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode;
28 import org.opendaylight.yangtools.yang.model.api.Module;
29 import org.opendaylight.yangtools.yang.model.api.ModuleImport;
30 import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
31 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
32 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
33 import org.opendaylight.yangtools.yang.model.api.UsesNode;
36 * Special case only use by GET restconf/operations (since moment of old Yang parser and old yang model API
37 * removal) to build and use fake container for module.
39 * @deprecated move to splitted module restconf-nb-rfc8040
42 final class FakeImportedModule extends ForwardingObject implements Module {
44 private final Module delegate;
46 FakeImportedModule(final Module delegate) {
47 this.delegate = Preconditions.checkNotNull(delegate);
51 protected Module delegate() {
56 public Set<TypeDefinition<?>> getTypeDefinitions() {
57 return ImmutableSet.of();
61 public Collection<DataSchemaNode> getChildNodes() {
62 return ImmutableList.of();
66 public Set<GroupingDefinition> getGroupings() {
67 return ImmutableSet.of();
71 public DataSchemaNode getDataChildByName(final QName name) {
76 public Set<UsesNode> getUses() {
77 return ImmutableSet.of();
81 public String getModuleSourcePath() {
86 public QNameModule getQNameModule() {
87 return delegate.getQNameModule();
91 public String getName() {
92 return delegate.getName();
96 public URI getNamespace() {
97 return delegate.getNamespace();
101 public Date getRevision() {
102 return delegate.getRevision();
106 public String getPrefix() {
107 return delegate.getPrefix();
111 public String getYangVersion() {
112 return delegate.getYangVersion();
116 public String getDescription() {
117 return delegate.getDescription();
121 public String getReference() {
122 return delegate.getReference();
126 public String getOrganization() {
127 return delegate.getOrganization();
131 public String getContact() {
132 return delegate.getContact();
136 public Set<ModuleImport> getImports() {
137 return ImmutableSet.of();
141 public Set<Module> getSubmodules() {
142 return ImmutableSet.of();
146 public Set<FeatureDefinition> getFeatures() {
147 return ImmutableSet.of();
151 public Set<AugmentationSchema> getAugmentations() {
152 return ImmutableSet.of();
156 public Set<RpcDefinition> getRpcs() {
157 return ImmutableSet.of();
161 public Set<Deviation> getDeviations() {
162 return ImmutableSet.of();
166 public Set<IdentitySchemaNode> getIdentities() {
167 return ImmutableSet.of();
171 public List<ExtensionDefinition> getExtensionSchemaNodes() {
172 return ImmutableList.of();
176 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
177 return ImmutableList.of();
181 public String getSource() {