X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fmessages%2FSwitchShardBehavior.java;h=4e9f9cb373cc7c764218df8a1c1a2da58b193e9d;hb=7161b121b21aeea325fe33485c841af31f9f0cfd;hp=f1c2a07b8411704a8ce79802dfcc2644e4c47f3a;hpb=c00bac2fb85ceef7a00973bd0be5ba378139e0aa;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/SwitchShardBehavior.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/SwitchShardBehavior.java index f1c2a07b84..4e9f9cb373 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/SwitchShardBehavior.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/SwitchShardBehavior.java @@ -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; }