819d837244cd0b267caf761741f90311015dfefc
[mdsal.git] / dom / mdsal-dom-spi / src / main / java / org / opendaylight / mdsal / dom / spi / shard / WriteableNodeWithSubshard.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.mdsal.dom.spi.shard;
9
10 import com.google.common.annotations.Beta;
11 import com.google.common.collect.ImmutableMap;
12 import java.util.Map;
13 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
14
15 @Beta
16 @Deprecated(forRemoval = true)
17 public abstract class WriteableNodeWithSubshard extends WriteableModificationNode {
18
19     private final Map<PathArgument, WriteableModificationNode> children;
20
21     protected WriteableNodeWithSubshard(final Map<PathArgument, WriteableModificationNode> children) {
22         this.children = ImmutableMap.copyOf(children);
23     }
24
25     @Override
26     public Map<PathArgument, WriteableModificationNode> getChildrenWithSubshards() {
27         return children;
28     }
29
30     @Override
31     public WriteableModificationNode getChild(final PathArgument node) {
32         return children.get(node);
33     }
34
35     @Override
36     public void markDeleted() {
37         for (WriteableModificationNode child : children.values()) {
38             child.markDeleted();
39         }
40     }
41 }