Do not generate 'isFoo()' methods
[mdsal.git] / dom / mdsal-dom-spi / src / main / java / org / opendaylight / mdsal / dom / spi / shard / SubshardProducerSpecification.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 java.util.ArrayList;
14 import java.util.Collection;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
17 import org.opendaylight.yangtools.concepts.Mutable;
18
19 /**
20  * Specification of subshard producer context that's used for building modification factories that span into the
21  * subshards. This class is not thread-safe.
22  *
23  * @deprecated This interface is scheduled for removal in the next major release.
24  */
25 @Deprecated(forRemoval = true)
26 @Beta
27 @NonNullByDefault
28 public final class SubshardProducerSpecification implements Mutable {
29     private final Collection<DOMDataTreeIdentifier> prefixes = new ArrayList<>(1);
30     private final ChildShardContext shard;
31
32     public SubshardProducerSpecification(final ChildShardContext subshard) {
33         this.shard = requireNonNull(subshard);
34     }
35
36     public void addPrefix(final DOMDataTreeIdentifier prefix) {
37         prefixes.add(prefix);
38     }
39
40     public DOMDataTreeShardProducer createProducer() {
41         return shard.getShard().createProducer(prefixes);
42     }
43
44     public DOMDataTreeIdentifier getPrefix() {
45         return shard.getPrefix();
46     }
47 }