Make SwitchShardBehavior transport RaftState
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / SwitchShardBehavior.java
index f1c2a07b8411704a8ce79802dfcc2644e4c47f3a..4e9f9cb373cc7c764218df8a1c1a2da58b193e9d 100644 (file)
@@ -8,14 +8,17 @@
 
 package org.opendaylight.controller.cluster.datastore.messages;
 
-public class SwitchShardBehavior {
+import com.google.common.base.Preconditions;
+import org.opendaylight.controller.cluster.raft.RaftState;
+
+public final class SwitchShardBehavior {
     private final String shardName;
-    private final String newState;
+    private final RaftState newState;
     private final long term;
 
-    public SwitchShardBehavior(String shardName, String newState, long term) {
-        this.shardName = shardName;
-        this.newState = newState;
+    public SwitchShardBehavior(String shardName, RaftState newState, long term) {
+        this.shardName = Preconditions.checkNotNull(shardName);
+        this.newState = Preconditions.checkNotNull(newState);
         this.term = term;
     }
 
@@ -23,7 +26,7 @@ public class SwitchShardBehavior {
         return shardName;
     }
 
-    public String getNewState() {
+    public RaftState getNewState() {
         return newState;
     }