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.yangtools.yang.data.util;
10 import java.util.ArrayList;
11 import java.util.Collection;
12 import java.util.Collections;
13 import java.util.List;
15 import javax.annotation.Nonnull;
16 import org.opendaylight.yangtools.yang.common.QName;
17 import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
18 import org.opendaylight.yangtools.yang.model.api.ConstraintDefinition;
19 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
20 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
21 import org.opendaylight.yangtools.yang.model.api.GroupingDefinition;
22 import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
23 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
24 import org.opendaylight.yangtools.yang.model.api.Status;
25 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
26 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
27 import org.opendaylight.yangtools.yang.model.api.UsesNode;
29 public final class RpcAsContainer implements ContainerSchemaNode {
31 private final RpcDefinition delegate;
34 public String getDescription() {
35 return delegate.getDescription();
39 public String getReference() {
40 return delegate.getReference();
44 public Set<TypeDefinition<?>> getTypeDefinitions() {
45 return delegate.getTypeDefinitions();
49 public Set<GroupingDefinition> getGroupings() {
50 return delegate.getGroupings();
55 public Status getStatus() {
56 return delegate.getStatus();
59 public ContainerSchemaNode getInput() {
60 return delegate.getInput();
63 public ContainerSchemaNode getOutput() {
64 return delegate.getOutput();
67 public RpcAsContainer(final RpcDefinition parentNode) {
68 delegate = parentNode;
73 public QName getQName() {
74 return delegate.getQName();
79 public SchemaPath getPath() {
80 return delegate.getPath();
85 public List<UnknownSchemaNode> getUnknownSchemaNodes() {
86 return Collections.emptyList();
90 public DataSchemaNode getDataChildByName(final QName name) {
91 // FIXME: check QNameModule
92 switch (name.getLocalName()) {
94 return delegate.getInput();
96 return delegate.getOutput();
103 public Set<UsesNode> getUses() {
104 return Collections.emptySet();
108 public Set<AugmentationSchema> getAvailableAugmentations() {
109 return Collections.emptySet();
113 public boolean isPresenceContainer() {
118 public Collection<DataSchemaNode> getChildNodes() {
119 final List<DataSchemaNode> ret = new ArrayList<>();
120 final ContainerSchemaNode input = getInput();
121 final ContainerSchemaNode output = getOutput();
125 if (output != null) {
132 public boolean isAugmenting() {
137 public boolean isAddedByUses() {
142 public boolean isConfiguration() {
147 public ConstraintDefinition getConstraints() {
148 // TODO Auto-generated method stub