X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=atomix-storage%2Fsrc%2Fmain%2Fjava%2Fio%2Fatomix%2Fstorage%2Fjournal%2FIndexed.java;h=5bf7e6f4545f63aa9e823db05996782ac1d85094;hp=02e84d2b027bf46f1f81ad8300466138dbeb3bad;hb=88a1e0bc7269500b63f519e20145ae6f751485f1;hpb=926877f74ff564663d1e892cbad4c13a25e7e373 diff --git a/atomix-storage/src/main/java/io/atomix/storage/journal/Indexed.java b/atomix-storage/src/main/java/io/atomix/storage/journal/Indexed.java index 02e84d2b02..5bf7e6f454 100644 --- a/atomix-storage/src/main/java/io/atomix/storage/journal/Indexed.java +++ b/atomix-storage/src/main/java/io/atomix/storage/journal/Indexed.java @@ -16,7 +16,10 @@ */ package io.atomix.storage.journal; +import static java.util.Objects.requireNonNull; + import com.google.common.base.MoreObjects; +import org.eclipse.jdt.annotation.NonNullByDefault; /** * Indexed journal entry. @@ -26,10 +29,14 @@ import com.google.common.base.MoreObjects; * @param entry the indexed entry * @param size the serialized entry size */ -// FIXME: add @NonNullByDefault and enforce non-null entry once we can say that entries cannot be null // FIXME: it seems 'index' has to be non-zero, we should enforce that if that really is the case // FIXME: it seems 'size' has not be non-zero, we should enforce that if that really is the case +@NonNullByDefault public record Indexed(long index, E entry, int size) { + public Indexed { + requireNonNull(entry); + } + @Override public String toString() { return MoreObjects.toStringHelper(this).add("index", index).add("entry", entry).toString();