Record Class CacheWarmerManager.CacheWarmingResult

java.lang.Object
java.lang.Record
cloud.opencode.base.cache.warming.CacheWarmerManager.CacheWarmingResult
Record Components:
cacheName - the cache name | 缓存名称
entriesLoaded - the number of entries loaded | 加载的条目数
duration - the warming duration | 预热持续时间
error - the error, if any | 错误(如有)
Enclosing class:
CacheWarmerManager

public static record CacheWarmerManager.CacheWarmingResult(String cacheName, int entriesLoaded, Duration duration, Throwable error) extends Record
Result for a single cache warming 单个缓存预热结果
Since:
JDK 25, opencode-base-cache V2.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • CacheWarmingResult

      public CacheWarmingResult(String cacheName, int entriesLoaded, Duration duration, Throwable error)
      Creates an instance of a CacheWarmingResult record class.
      Parameters:
      cacheName - the value for the cacheName record component
      entriesLoaded - the value for the entriesLoaded record component
      duration - the value for the duration record component
      error - the value for the error record component
  • Method Details

    • isSuccess

      public boolean isSuccess()
      isSuccess | isSuccess
      Returns:
      the result | 结果
    • 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.
    • cacheName

      public String cacheName()
      Returns the value of the cacheName record component.
      Returns:
      the value of the cacheName record component
    • entriesLoaded

      public int entriesLoaded()
      Returns the value of the entriesLoaded record component.
      Returns:
      the value of the entriesLoaded record component
    • duration

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

      public Throwable error()
      Returns the value of the error record component.
      Returns:
      the value of the error record component