package org.opendaylight.yangtools.yang.model.util;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
-
import org.opendaylight.yangtools.yang.model.api.ChoiceCaseNode;
-import org.opendaylight.yangtools.yang.model.api.ChoiceNode;
+import org.opendaylight.yangtools.yang.model.api.ChoiceSchemaNode;
import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
private final DataNodeContainer container;
private final List<ListSchemaNode> allLists;
private final List<ContainerSchemaNode> allContainers;
- private final List<ChoiceNode> allChoices;
+ private final List<ChoiceSchemaNode> allChoices;
private final List<DataSchemaNode> allChilds;
private final List<GroupingDefinition> allGroupings;
private final List<TypeDefinition<?>> allTypedefs;
*
* @return Returns list all containers present in subtree.
*/
- public List<ChoiceNode> allChoices() {
+ public List<ChoiceSchemaNode> allChoices() {
return allChoices;
}
return;
}
- final Set<DataSchemaNode> childNodes = dataNode.getChildNodes();
+ final Iterable<DataSchemaNode> childNodes = dataNode.getChildNodes();
if (childNodes != null) {
for (DataSchemaNode childNode : childNodes) {
if (childNode.isAugmenting()) {
final ListSchemaNode list = (ListSchemaNode) childNode;
allLists.add(list);
traverse(list);
- } else if (childNode instanceof ChoiceNode) {
- final ChoiceNode choiceNode = (ChoiceNode) childNode;
+ } else if (childNode instanceof ChoiceSchemaNode) {
+ final ChoiceSchemaNode choiceNode = (ChoiceSchemaNode) childNode;
allChoices.add(choiceNode);
final Set<ChoiceCaseNode> cases = choiceNode.getCases();
if (cases != null) {
if (input != null) {
traverse(input);
}
- ContainerSchemaNode output = rpcDefinition.getInput();
- if (input != null) {
+ ContainerSchemaNode output = rpcDefinition.getOutput();
+ if (output != null) {
traverse(output);
}
}
@Override
public boolean hasNext() {
if (container.getChildNodes() != null) {
- final Set<DataSchemaNode> childNodes = container.getChildNodes();
+ final Collection<DataSchemaNode> childNodes = container.getChildNodes();
if ((childNodes != null) && !childNodes.isEmpty()) {
return childNodes.iterator().hasNext();