*/
package org.opendaylight.yangtools.yang.data.impl.schema.nodes;
+import java.util.Collections;
import java.util.Map;
import org.opendaylight.yangtools.concepts.Immutable;
protected final Map<PathArgument, DataContainerChild<? extends PathArgument, ?>> children;
-
public AbstractImmutableDataContainerNode(
final Map<PathArgument, DataContainerChild<? extends PathArgument, ?>> children, final K nodeIdentifier) {
- super(nodeIdentifier, Iterables.unmodifiableIterable(children.values()));
+ super(nodeIdentifier);
this.children = children;
}
return Optional.<DataContainerChild<? extends PathArgument, ?>> fromNullable(children.get(child));
}
+ @Override
+ public final Iterable<DataContainerChild<? extends PathArgument, ?>> getValue() {
+ return Iterables.unmodifiableIterable(children.values());
+ }
+
@Override
protected int valueHashCode() {
return children.hashCode();
}
+ public final Map<PathArgument, DataContainerChild<? extends PathArgument, ?>> getChildren() {
+ // Make sure we do not leak a mutable view
+ return Collections.unmodifiableMap(children);
+ }
+
@Override
protected boolean valueEquals(final AbstractImmutableNormalizedNode<?, ?> other) {
if (!(other instanceof AbstractImmutableDataContainerNode<?>)) {