e5ccab64608fc8c006eab80343c8cce5fc06c912
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / config / ShardConfig.java
1 /*
2  * Copyright (c) 2015 Brocade Communications 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.controller.cluster.datastore.config;
9
10 import com.google.common.base.Preconditions;
11 import com.google.common.collect.ImmutableSet;
12 import java.util.Collection;
13 import java.util.Set;
14 import javax.annotation.Nonnull;
15
16 /**
17  * Encapsulated configuration for a shard.
18  */
19 public class ShardConfig {
20     private final String name;
21     private final Set<String> replicas;
22
23     public ShardConfig(@Nonnull final String name, @Nonnull final Collection<String> replicas) {
24         this.name = Preconditions.checkNotNull(name);
25         this.replicas = ImmutableSet.copyOf(Preconditions.checkNotNull(replicas));
26     }
27
28     @Nonnull
29     public String getName() {
30         return name;
31     }
32
33     @Nonnull
34     public Set<String> getReplicas() {
35         return replicas;
36     }
37 }