4c3f5a6015b1616c8a47e88dc7e386d9d83ab1bb
[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
9 package org.opendaylight.mdsal.dom.spi.shard;
10
11 import com.google.common.annotations.Beta;
12 import com.google.common.base.Preconditions;
13 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
14
15 /**
16  * Definition of a subshard containing the prefix and the subshard.
17  */
18 @Beta
19 public final class ChildShardContext {
20     private final WriteableDOMDataTreeShard shard;
21     private final DOMDataTreeIdentifier prefix;
22
23     public ChildShardContext(final DOMDataTreeIdentifier prefix, final WriteableDOMDataTreeShard shard) {
24         this.prefix = Preconditions.checkNotNull(prefix);
25         this.shard = Preconditions.checkNotNull(shard);
26     }
27
28     public WriteableDOMDataTreeShard getShard() {
29         return shard;
30     }
31
32     public DOMDataTreeIdentifier getPrefix() {
33         return prefix;
34     }
35 }