import static com.google.common.base.Preconditions.checkState;
import java.util.Collections;
-import java.util.LinkedHashMap;
+import java.util.HashMap;
import java.util.Map;
import org.opendaylight.yangtools.concepts.Identifiable;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
-import com.google.common.collect.Iterables;
import com.google.common.primitives.UnsignedLong;
public class StoreMetadataNode implements Immutable, Identifiable<PathArgument>, StoreTreeNode<StoreMetadataNode> {
return this.data;
}
- public Iterable<StoreMetadataNode> getChildren() {
- return Iterables.unmodifiableIterable(children.values());
- }
-
@Override
public Optional<StoreMetadataNode> getChild(final PathArgument key) {
return Optional.fromNullable(children.get(key));
private boolean dirty = false;
private Builder() {
- children = new LinkedHashMap<>();
+ children = new HashMap<>();
}
public Builder(StoreMetadataNode node) {
- children = new LinkedHashMap<>(node.children);
+ children = new HashMap<>(node.children);
}
public UnsignedLong getVersion() {
public Builder add(final StoreMetadataNode node) {
if (dirty) {
- children = new LinkedHashMap<>(children);
+ children = new HashMap<>(children);
dirty = false;
}
children.put(node.getIdentifier(), node);
public Builder remove(final PathArgument id) {
if (dirty) {
- children = new LinkedHashMap<>(children);
+ children = new HashMap<>(children);
dirty = false;
}
children.remove(id);