Class ServerPropertiesManager.SetAllResult

java.lang.Object
com.ultikits.ultitools.manager.ServerPropertiesManager.SetAllResult
Enclosing class:
ServerPropertiesManager

@Internal public static final class ServerPropertiesManager.SetAllResult extends Object
Outcome of one set_all batch.

isSuccess() means every key the caller asked for is now on disk, which is the batch analogue of what action: "set" already reports for a single key. Keys carrying an explicit JSON null are not part of that promise — a null reads as "leave this one alone", so it is recorded in getSkipped() for visibility but never fails the batch.

一次 set_all 的结果。isSuccess() 的含义是 调用方要求写的每一个键现在都在磁盘上,也就是单键 set 早就在报的那件事的批量版。 值为 JSON null 的键不在这个承诺范围内 —— null 读作「这个别动」, 因此它只被记进 getSkipped() 以便可见,不会让整批失败。

  • Field Details

  • Constructor Details

    • SetAllResult

      public SetAllResult(List<String> updated, List<String> rejected, List<String> failed, List<String> skipped, List<String> malformed)
      Public so callers outside this package can build one. Each list is copied before being wrapped — unmodifiableList is a view, so wrapping the caller's list directly would leave this "immutable" object mutable through the original reference.

      公开是为了包外也能构造。每个列表都先复制再包装 —— unmodifiableList 是视图, 直接包装调用方的列表会让这个「不可变」对象仍能通过原引用被改。

  • Method Details

    • getUpdated

      public List<String> getUpdated()
      Keys written to disk. 已写入磁盘的键。
    • getRejected

      public List<String> getRejected()
      Keys refused because they are not on the whitelist. 因不在白名单而被拒的键。
    • getFailed

      public List<String> getFailed()
      Whitelisted keys whose write failed. 在白名单里但写入失败的键。
    • getSkipped

      public List<String> getSkipped()
      Keys whose value was an explicit JSON null. 值为 JSON null 因而被跳过的键。
    • getMalformed

      public List<String> getMalformed()
      Keys whose value was not a JSON primitive. 值不是 JSON 原始值因而无法作为属性写入的键。
    • isSuccess

      public boolean isSuccess()
      Every requested key was written. 要求写的键全部写成功。
    • describeFailure

      public String describeFailure()
      One line naming what went wrong, for a log record or an error response. Returns null when nothing went wrong.

      The three categories stay separate because they need three different actions: a rejected key means stop asking for it, a failed key means look at the disk, and a malformed key means fix the payload. Collapsing them into one label would send the reader looking in the wrong place — which is the failure mode this whole change exists to remove.

      一句话说明哪里没成,用于日志或错误响应;全部成功时返回 null。 三类分开写,是因为它们要三种不同的处置:被拒 = 别再要这个键,写入失败 = 去看磁盘, 畸形 = 去修载荷。合成一个标签会把人指向错误的方向,而那正是这次改动要消灭的失败形态。