import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
+import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
}
@Override
- public CollectionNodeBuilder<UnkeyedListEntryNode, UnkeyedListNode> withValue(final List<UnkeyedListEntryNode> value) {
+ public CollectionNodeBuilder<UnkeyedListEntryNode, UnkeyedListNode> withValue(final Collection<UnkeyedListEntryNode> value) {
// TODO replace or putAll ?
for (final UnkeyedListEntryNode UnkeyedListEntryNode : value) {
withChild(UnkeyedListEntryNode);
return withoutChild(key);
}
- protected static final class EmptyImmutableUnkeyedListNode extends AbstractImmutableNormalizedNode<YangInstanceIdentifier.NodeIdentifier, Iterable<UnkeyedListEntryNode>> implements Immutable, UnkeyedListNode {
+ protected static final class EmptyImmutableUnkeyedListNode extends AbstractImmutableNormalizedNode<YangInstanceIdentifier.NodeIdentifier, Collection<UnkeyedListEntryNode>> implements Immutable, UnkeyedListNode {
protected EmptyImmutableUnkeyedListNode(final NodeIdentifier nodeIdentifier) {
super(nodeIdentifier);
}
@Override
- public Iterable<UnkeyedListEntryNode> getValue() {
- return Collections.emptyList();
+ public Collection<UnkeyedListEntryNode> getValue() {
+ return Collections.emptySet();
}
@Override
public UnkeyedListEntryNode getChild(final int position) {
- return null;
+ throw new IndexOutOfBoundsException();
}
@Override
}
protected static final class ImmutableUnkeyedListNode extends
- AbstractImmutableNormalizedValueNode<YangInstanceIdentifier.NodeIdentifier, Iterable<UnkeyedListEntryNode>>
+ AbstractImmutableNormalizedValueNode<YangInstanceIdentifier.NodeIdentifier, Collection<UnkeyedListEntryNode>>
implements Immutable, UnkeyedListNode {
private final ImmutableList<UnkeyedListEntryNode> children;