Switch to Objects.requireNonNull
[mdsal.git] / dom / mdsal-dom-inmemory-datastore / src / main / java / org / opendaylight / mdsal / dom / store / inmemory / InMemoryShardDataModificationCursor.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 static java.util.Objects.requireNonNull;
12
13 import org.opendaylight.mdsal.dom.spi.shard.AbstractDataModificationCursor;
14 import org.opendaylight.mdsal.dom.spi.shard.WriteCursorStrategy;
15
16 class InMemoryShardDataModificationCursor extends AbstractDataModificationCursor<ShardDataModification> {
17
18     private InmemoryDOMDataTreeShardWriteTransaction parent;
19
20     InMemoryShardDataModificationCursor(final ShardDataModification root,
21                                         final InmemoryDOMDataTreeShardWriteTransaction parent) {
22         super(root);
23         this.parent = requireNonNull(parent);
24     }
25
26     @Override
27     protected WriteCursorStrategy getRootOperation(final ShardDataModification root) {
28         return root.createOperation(null);
29     }
30
31     @Override
32     public void close() {
33         parent.cursorClosed();
34     }
35
36 }