Merge branch 'blueprint' from controller
[mdsal.git] / dom / mdsal-dom-spi / src / main / java / org / opendaylight / mdsal / dom / spi / shard / ChildShardContext.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 static java.util.Objects.requireNonNull;
11
12 import com.google.common.annotations.Beta;
13 import org.eclipse.jdt.annotation.NonNullByDefault;
14 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
15
16 /**
17  * Definition of a subshard containing the prefix and the subshard.
18  */
19 @Beta
20 @NonNullByDefault
21 public final class ChildShardContext {
22     private final WriteableDOMDataTreeShard shard;
23     private final DOMDataTreeIdentifier prefix;
24
25     public ChildShardContext(final DOMDataTreeIdentifier prefix, final WriteableDOMDataTreeShard shard) {
26         this.prefix = requireNonNull(prefix);
27         this.shard = requireNonNull(shard);
28     }
29
30     public WriteableDOMDataTreeShard getShard() {
31         return shard;
32     }
33
34     public DOMDataTreeIdentifier getPrefix() {
35         return prefix;
36     }
37 }