X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fconfig%2FModuleShardConfiguration.java;h=177eb8d7342fe5f5b6f523af9a7121faa536cec1;hb=99f80f27bee37bb23e345420bf14bb7bb4793c28;hp=e4b88fb07d95084851e46efe6ff6203708dad0ee;hpb=5273c33b6f2051a7e3b1afcc4eeae4e457b6f26c;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/config/ModuleShardConfiguration.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/config/ModuleShardConfiguration.java index e4b88fb07d..177eb8d734 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/config/ModuleShardConfiguration.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/config/ModuleShardConfiguration.java @@ -7,11 +7,13 @@ */ package org.opendaylight.controller.cluster.datastore.config; -import com.google.common.base.Preconditions; -import java.net.URI; +import static java.util.Objects.requireNonNull; + import java.util.Collection; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.controller.cluster.access.concepts.MemberName; +import org.opendaylight.yangtools.yang.common.XMLNamespace; /** * Encapsulates information for adding a new module shard configuration. @@ -19,11 +21,11 @@ import javax.annotation.Nullable; * @author Thomas Pantelis */ public class ModuleShardConfiguration { - private final URI namespace; + private final XMLNamespace namespace; private final String moduleName; private final String shardName; private final String shardStrategyName; - private final Collection shardMemberNames; + private final Collection shardMemberNames; /** * Constructs a new instance. @@ -35,16 +37,17 @@ public class ModuleShardConfiguration { * is used. * @param shardMemberNames the names of the shard's member replicas. */ - public ModuleShardConfiguration(@Nonnull URI namespace, @Nonnull String moduleName, @Nonnull String shardName, - @Nullable String shardStrategyName, @Nonnull Collection shardMemberNames) { - this.namespace = Preconditions.checkNotNull(namespace, "nameSpace should not be null"); - this.moduleName = Preconditions.checkNotNull(moduleName, "moduleName should not be null"); - this.shardName = Preconditions.checkNotNull(shardName, "shardName should not be null"); + public ModuleShardConfiguration(final @NonNull XMLNamespace namespace, final @NonNull String moduleName, + final @NonNull String shardName, final @Nullable String shardStrategyName, + final @NonNull Collection shardMemberNames) { + this.namespace = requireNonNull(namespace, "nameSpace should not be null"); + this.moduleName = requireNonNull(moduleName, "moduleName should not be null"); + this.shardName = requireNonNull(shardName, "shardName should not be null"); this.shardStrategyName = shardStrategyName; - this.shardMemberNames = Preconditions.checkNotNull(shardMemberNames, "shardMemberNames"); + this.shardMemberNames = requireNonNull(shardMemberNames, "shardMemberNames"); } - public URI getNamespace() { + public XMLNamespace getNamespace() { return namespace; } @@ -60,7 +63,14 @@ public class ModuleShardConfiguration { return shardStrategyName; } - public Collection getShardMemberNames() { + public Collection getShardMemberNames() { return shardMemberNames; } + + @Override + public String toString() { + return "ModuleShardConfiguration [namespace=" + namespace + ", moduleName=" + moduleName + ", shardName=" + + shardName + ", shardMemberNames=" + shardMemberNames + ", shardStrategyName=" + shardStrategyName + + "]"; + } }