X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-clustering-commons%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fnotifications%2FLeaderStateChanged.java;h=373823ef0ffeaf0ac37140aab1d437c7e4753979;hb=HEAD;hp=5de794d902d69976aeb0761939aebb4470269d9a;hpb=81674d6fd50b419b868d0851062e23f34b34557d;p=controller.git diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/notifications/LeaderStateChanged.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/notifications/LeaderStateChanged.java index 5de794d902..373823ef0f 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/notifications/LeaderStateChanged.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/notifications/LeaderStateChanged.java @@ -7,10 +7,10 @@ */ package org.opendaylight.controller.cluster.notifications; -import com.google.common.base.Preconditions; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import static java.util.Objects.requireNonNull; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; /** * A local message initiated internally from the RaftActor when some state of a leader has changed. @@ -18,17 +18,18 @@ import javax.annotation.Nullable; * @author Thomas Pantelis */ public class LeaderStateChanged { - private final String memberId; - private final String leaderId; + private final @NonNull String memberId; + private final @Nullable String leaderId; private final short leaderPayloadVersion; - public LeaderStateChanged(@Nonnull String memberId, @Nullable String leaderId, short leaderPayloadVersion) { - this.memberId = Preconditions.checkNotNull(memberId); + public LeaderStateChanged(final @NonNull String memberId, final @Nullable String leaderId, + final short leaderPayloadVersion) { + this.memberId = requireNonNull(memberId); this.leaderId = leaderId; this.leaderPayloadVersion = leaderPayloadVersion; } - public @Nonnull String getMemberId() { + public @NonNull String getMemberId() { return memberId; }