package com.xfestudio.xfeservermanager.core.rollback;
import java.time.Instant;
import java.util.Objects;
/** Explicit overload/retention gap; a plan containing one can never claim complete recovery. */
public record JournalGap(Instant fromInclusive, Instant toExclusive, String reason, long droppedEvents) {
public JournalGap {
Objects.requireNonNull(fromInclusive, "fromInclusive");
Objects.requireNonNull(toExclusive, "toExclusive");
if (toExclusive.isBefore(fromInclusive)) throw new IllegalArgumentException("invalid gap range");
if (reason == null || reason.isBlank()) throw new IllegalArgumentException("reason must not be blank");
if (droppedEvents < 0) throw new IllegalArgumentException("droppedEvents must be non-negative");
}
}
package com.xfestudio.xfeservermanager.core.rollback;
import java.time.Instant;
import java.util.Objects;
/** Explicit overload/retention gap; a plan containing one can never claim complete recovery. */
public record JournalGap(Instant fromInclusive, Instant toExclusive, String reason, long droppedEvents) {
public JournalGap {
Objects.requireNonNull(fromInclusive, "fromInclusive");
Objects.requireNonNull(toExclusive, "toExclusive");
if (toExclusive.isBefore(fromInclusive)) throw new IllegalArgumentException("invalid gap range");
if (reason == null || reason.isBlank()) throw new IllegalArgumentException("reason must not be blank");
if (droppedEvents < 0) throw new IllegalArgumentException("droppedEvents must be non-negative");
}
}