Record Class CacheWarmer.ProgressSnapshot<K>

java.lang.Object
java.lang.Record
cloud.opencode.base.cache.warming.CacheWarmer.ProgressSnapshot<K>
Type Parameters:
K - the key type | 键类型
Record Components:
totalKeys - the total number of keys | 总键数
warmedCount - the number of warmed keys | 已预热的键数
failedCount - the number of failed keys | 失败的键数
skippedCount - the number of skipped keys | 跳过的键数
elapsed - the elapsed time | 已用时间
Enclosing class:
CacheWarmer<K,V>

public static record CacheWarmer.ProgressSnapshot<K>(int totalKeys, int warmedCount, int failedCount, int skippedCount, Duration elapsed) extends Record
Progress snapshot for callbacks 用于回调的进度快照
Since:
JDK 25, opencode-base-cache V2.0.5
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • ProgressSnapshot

      public ProgressSnapshot(int totalKeys, int warmedCount, int failedCount, int skippedCount, Duration elapsed)
      Creates an instance of a ProgressSnapshot record class.
      Parameters:
      totalKeys - the value for the totalKeys record component
      warmedCount - the value for the warmedCount record component
      failedCount - the value for the failedCount record component
      skippedCount - the value for the skippedCount record component
      elapsed - the value for the elapsed record component
  • Method Details

    • percentComplete

      public double percentComplete()
      Returns the completion percentage | 返回完成百分比
      Returns:
      percent complete | 完成百分比
    • remaining

      public int remaining()
      Returns the remaining count | 返回剩余数
      Returns:
      remaining keys | 剩余键数
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • totalKeys

      public int totalKeys()
      Returns the value of the totalKeys record component.
      Returns:
      the value of the totalKeys record component
    • warmedCount

      public int warmedCount()
      Returns the value of the warmedCount record component.
      Returns:
      the value of the warmedCount record component
    • failedCount

      public int failedCount()
      Returns the value of the failedCount record component.
      Returns:
      the value of the failedCount record component
    • skippedCount

      public int skippedCount()
      Returns the value of the skippedCount record component.
      Returns:
      the value of the skippedCount record component
    • elapsed

      public Duration elapsed()
      Returns the value of the elapsed record component.
      Returns:
      the value of the elapsed record component