checkStyleViolationSeverity=error implemented for mdsal-dom-inmemory-datastore
[mdsal.git] / dom / mdsal-dom-inmemory-datastore / src / main / java / org / opendaylight / mdsal / dom / store / inmemory / WriteableModificationNode.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
9 package org.opendaylight.mdsal.dom.store.inmemory;
10
11 import java.util.Map;
12 import javax.annotation.Nonnull;
13 import javax.annotation.Nullable;
14 import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteCursor;
15 import org.opendaylight.yangtools.concepts.Identifiable;
16 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
17
18 abstract class WriteableModificationNode implements Identifiable<PathArgument> {
19
20     /**
21      * Gets child which is on path towards subshard.
22      *
23      * @return null if requested child is not subshard or enclosing node of any subshard.
24      */
25     abstract @Nullable WriteableModificationNode getChild(@Nonnull PathArgument node);
26
27     abstract Map<PathArgument, WriteableModificationNode> getChildrenWithSubshards();
28
29     /**
30      * Creates operation used to modify this node and its children.
31      *
32      * @param parentCursor Cursor associated with parent shard
33      * @return WriteableOperation for this node.
34      */
35     abstract WriteCursorStrategy createOperation(DOMDataTreeWriteCursor parentCursor);
36
37     abstract void markDeleted();
38
39 }