Improve segmented journal actor metrics
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / FindPrimary.java
index 0b7fcf0ed507160866b2e220f5e21b93d43bf3fb..52709dd705828d2080dbd588052f7a973279b4c9 100644 (file)
@@ -5,15 +5,14 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.controller.cluster.datastore.messages;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.io.Serializable;
 
 /**
- * The FindPrimary message is used to locate the primary of any given shard
- *
+ * The FindPrimary message is used to locate the primary of any given shard.
  */
 public class FindPrimary implements Serializable {
     private static final long serialVersionUID = 1L;
@@ -21,11 +20,8 @@ public class FindPrimary implements Serializable {
     private final String shardName;
     private final boolean waitUntilReady;
 
-    public FindPrimary(String shardName, boolean waitUntilReady) {
-
-        Preconditions.checkNotNull(shardName, "shardName should not be null");
-
-        this.shardName = shardName;
+    public FindPrimary(final String shardName, final boolean waitUntilReady) {
+        this.shardName = requireNonNull(shardName, "shardName should not be null");
         this.waitUntilReady = waitUntilReady;
     }
 
@@ -39,9 +35,7 @@ public class FindPrimary implements Serializable {
 
     @Override
     public String toString() {
-        StringBuilder builder = new StringBuilder();
-        builder.append(getClass().getName()).append(" [shardName=").append(shardName).append(", waitUntilReady=")
-               .append(waitUntilReady).append("]");
-        return builder.toString();
+        return getClass().getName() + " [shardName=" + shardName
+                + ", waitUntilReady=" + waitUntilReady + "]";
     }
 }