Raise EOS unsuccessful request reporting to error
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / config / ModuleShardConfiguration.java
index e4b88fb07d95084851e46efe6ff6203708dad0ee..d858b5f962ae0799d1adc9d00f783dea9bcfc76b 100644 (file)
@@ -7,11 +7,13 @@
  */
 package org.opendaylight.controller.cluster.datastore.config;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.net.URI;
 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;
 
 /**
  * Encapsulates information for adding a new module shard configuration.
@@ -23,7 +25,7 @@ public class ModuleShardConfiguration {
     private final String moduleName;
     private final String shardName;
     private final String shardStrategyName;
-    private final Collection<String> shardMemberNames;
+    private final Collection<MemberName> shardMemberNames;
 
     /**
      * Constructs a new instance.
@@ -35,13 +37,13 @@ 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<String> 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(@NonNull URI namespace, @NonNull String moduleName, @NonNull String shardName,
+            @Nullable String shardStrategyName, @NonNull Collection<MemberName> 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() {
@@ -60,7 +62,14 @@ public class ModuleShardConfiguration {
         return shardStrategyName;
     }
 
-    public Collection<String> getShardMemberNames() {
+    public Collection<MemberName> getShardMemberNames() {
         return shardMemberNames;
     }
+
+    @Override
+    public String toString() {
+        return "ModuleShardConfiguration [namespace=" + namespace + ", moduleName=" + moduleName + ", shardName="
+                + shardName + ", shardMemberNames=" + shardMemberNames + ", shardStrategyName=" + shardStrategyName
+                + "]";
+    }
 }