X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fraft%2Fpersisted%2FByteState.java;h=039c15c8f4a374604085c02e9f85f0ad2f4ecd6c;hb=b4bf55727093657662d8c16a50fa85f87978a586;hp=42411a95c4c28f6bc48ef1d965d3535e6136773f;hpb=2faf656bf68dd3843fd59520b27a7ec2abbdcc68;p=controller.git diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/persisted/ByteState.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/persisted/ByteState.java index 42411a95c4..039c15c8f4 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/persisted/ByteState.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/persisted/ByteState.java @@ -7,33 +7,34 @@ */ package org.opendaylight.controller.cluster.raft.persisted; -import com.google.common.base.Preconditions; +import static java.util.Objects.requireNonNull; + import java.util.Arrays; -import javax.annotation.Nonnull; +import org.eclipse.jdt.annotation.NonNull; /** * Snapshot State implementation backed by a byte[]. * * @author Thomas Pantelis */ -public class ByteState implements Snapshot.State { +public final class ByteState implements Snapshot.State { private static final long serialVersionUID = 1L; - private final byte[] bytes; + private final byte @NonNull[] bytes; - private ByteState(@Nonnull byte[] bytes) { - this.bytes = Preconditions.checkNotNull(bytes); + private ByteState(final byte @NonNull[] bytes) { + this.bytes = requireNonNull(bytes); } - public static ByteState of(@Nonnull byte[] bytes) { + public static @NonNull ByteState of(final byte @NonNull[] bytes) { return new ByteState(bytes); } - public static ByteState empty() { + public static @NonNull ByteState empty() { return new ByteState(new byte[0]); } - public byte[] getBytes() { + public byte @NonNull[] getBytes() { return bytes; } @@ -46,7 +47,7 @@ public class ByteState implements Snapshot.State { } @Override - public boolean equals(Object obj) { + public boolean equals(final Object obj) { if (this == obj) { return true; }