Record Class CacheWarmer.WarmingResult<K>

java.lang.Object
java.lang.Record
cloud.opencode.base.cache.warming.CacheWarmer.WarmingResult<K>
Type Parameters:
K - the key type | 键类型
Record Components:
totalKeys - the total number of keys | 总键数
warmedCount - the number of successfully warmed keys | 成功预热的键数
failedCount - the number of failed keys | 失败的键数
skippedCount - the number of skipped keys | 跳过的键数
failedKeys - the set of failed keys | 失败的键集合
duration - the warming duration | 预热持续时间
Enclosing class:
CacheWarmer<K,V>

public static record CacheWarmer.WarmingResult<K>(int totalKeys, int warmedCount, int failedCount, int skippedCount, Set<K> failedKeys, Duration duration) extends Record
Warming result 预热结果
Since:
JDK 25, opencode-base-cache V2.0.5
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • WarmingResult

      public WarmingResult(int totalKeys, int warmedCount, int failedCount, int skippedCount, Set<K> failedKeys, Duration duration)
      Creates an instance of a WarmingResult 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
      failedKeys - the value for the failedKeys record component
      duration - the value for the duration record component
  • Method Details

    • successRate

      public double successRate()
      Returns the success rate | 返回成功率
      Returns:
      success rate (0.0 to 1.0) | 成功率
    • isComplete

      public boolean isComplete()
      Returns whether warming is complete | 返回预热是否完成
      Returns:
      true if complete | 完成返回 true
    • percentComplete

      public double percentComplete()
      Returns the completion percentage | 返回完成百分比
      Returns:
      percent complete | 完成百分比
    • 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
    • failedKeys

      public Set<K> failedKeys()
      Returns the value of the failedKeys record component.
      Returns:
      the value of the failedKeys record component
    • duration

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