Fix modernization issues
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / entityownership / messages / SelectOwner.java
index 250abf61487a288382b18802e1aa24cfc4b85eaf..cdb8c925eed7ba1831c88ca4d0fdc5f84eba8bdb 100644 (file)
@@ -5,29 +5,28 @@
  * 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.entityownership.messages;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.Collection;
 import org.opendaylight.controller.cluster.datastore.entityownership.selectionstrategy.EntityOwnerSelectionStrategy;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
 /**
- * Message sent when a new owner needs to be selected
+ * Message sent when a new owner needs to be selected.
  */
 public class SelectOwner {
     private final YangInstanceIdentifier entityPath;
     private final Collection<String> allCandidates;
     private final EntityOwnerSelectionStrategy ownerSelectionStrategy;
 
-    public SelectOwner(YangInstanceIdentifier entityPath, Collection<String> allCandidates,
-                       EntityOwnerSelectionStrategy ownerSelectionStrategy) {
-
-        this.entityPath = Preconditions.checkNotNull(entityPath, "entityPath should not be null");
-        this.allCandidates = Preconditions.checkNotNull(allCandidates, "allCandidates should not be null");
-        this.ownerSelectionStrategy = Preconditions.checkNotNull(ownerSelectionStrategy,
-                "ownerSelectionStrategy should not be null");
+    public SelectOwner(final YangInstanceIdentifier entityPath, final Collection<String> allCandidates,
+                       final EntityOwnerSelectionStrategy ownerSelectionStrategy) {
+        this.entityPath = requireNonNull(entityPath, "entityPath should not be null");
+        this.allCandidates = requireNonNull(allCandidates, "allCandidates should not be null");
+        this.ownerSelectionStrategy = requireNonNull(ownerSelectionStrategy,
+            "ownerSelectionStrategy should not be null");
     }
 
     public YangInstanceIdentifier getEntityPath() {
@@ -44,10 +43,7 @@ public class SelectOwner {
 
     @Override
     public String toString() {
-        return "SelectOwner{" +
-                "entityPath=" + entityPath +
-                ", allCandidates=" + allCandidates +
-                ", ownerSelectionStrategy=" + ownerSelectionStrategy +
-                '}';
+        return "SelectOwner [entityPath=" + entityPath + ", allCandidates=" + allCandidates
+                + ", ownerSelectionStrategy=" + ownerSelectionStrategy + "]";
     }
 }