XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFEServerManager

【Java】我的世界XFE服务器管理器

公开
关注 0 Fork 0 Star 0
UTF-8
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");
    }
}