Record Class RedisLoadWithLock<T>

java.lang.Object
java.lang.Record
com.codeupsoft.component.redis.client.RedisLoadWithLock<T>
Type Parameters:
T - 缓存数据类型

public record RedisLoadWithLock<T>(RedisCacheData<T> cacheData, Long lockerExpire) extends Record
Redis带锁缓存加载器.
Author:
Liu,Dongdong
  • Constructor Details

    • RedisLoadWithLock

      public RedisLoadWithLock(RedisCacheData<T> cacheData, Long lockerExpire)
      Creates an instance of a RedisLoadWithLock record class.
      Parameters:
      cacheData - the value for the cacheData record component
      lockerExpire - the value for the lockerExpire record component
  • Method Details

    • of

      public static <T> RedisLoadWithLock<T> of(RedisCacheData<T> cacheData)
      创建Redis带锁缓存加载器实例(使用默认锁过期时间).
      Type Parameters:
      T - 缓存数据类型
      Parameters:
      cacheData - 缓存数据
      Returns:
      Redis带锁缓存加载器实例
    • of

      public static <T> RedisLoadWithLock<T> of(RedisCacheData<T> cacheData, long lockerExpire, TimeUnit timeUnit)
      创建Redis带锁缓存加载器实例(指定锁过期时间).
      Type Parameters:
      T - 缓存数据类型
      Parameters:
      cacheData - 缓存数据
      lockerExpire - 锁过期时间
      timeUnit - 时间单位
      Returns:
      Redis带锁缓存加载器实例
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • cacheData

      public RedisCacheData<T> cacheData()
      Returns the value of the cacheData record component.
      Returns:
      the value of the cacheData record component
    • lockerExpire

      public Long lockerExpire()
      Returns the value of the lockerExpire record component.
      Returns:
      the value of the lockerExpire record component