Record Class RedisCacheData<T>
java.lang.Object
java.lang.Record
com.codeupsoft.component.redis.client.RedisCacheData<T>
- Type Parameters:
T- 缓存数据类型
-
Constructor Summary
ConstructorsConstructorDescriptionRedisCacheData(T value, long expire, TimeUnit timeUnit) Creates an instance of aRedisCacheDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.longexpire()Returns the value of theexpirerecord component.final inthashCode()Returns a hash code value for this object.static <T> RedisCacheData<T> of(T value) 创建缓存数据(使用默认不过期).static <T> RedisCacheData<T> 创建缓存数据(指定过期时间).timeUnit()Returns the value of thetimeUnitrecord component.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
RedisCacheData
-
-
Method Details
-
of
创建缓存数据(使用默认不过期).- Type Parameters:
T- 值类型- Parameters:
value- 值- Returns:
- 缓存数据
-
of
创建缓存数据(指定过期时间).- Type Parameters:
T- 值类型- Parameters:
value- 值expiration- 过期时间timeUnit- 时间单位- Returns:
- 缓存数据
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
expire
public long expire()Returns the value of theexpirerecord component.- Returns:
- the value of the
expirerecord component
-
timeUnit
Returns the value of thetimeUnitrecord component.- Returns:
- the value of the
timeUnitrecord component
-