Record Class BulkOperations.TtlValue<V>

java.lang.Object
java.lang.Record
cloud.opencode.base.cache.bulk.BulkOperations.TtlValue<V>
Type Parameters:
V - value type | 值类型
Record Components:
value - the value | 值
ttl - time to live | 存活时间
Enclosing class:
BulkOperations<K,V>

public static record BulkOperations.TtlValue<V>(V value, Duration ttl) extends Record
Value with TTL for bulk put 用于批量放置的带 TTL 的值
Since:
JDK 25, opencode-base-cache V2.0.5
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • TtlValue

      public TtlValue(V value, Duration ttl)
      Creates an instance of a TtlValue record class.
      Parameters:
      value - the value for the value record component
      ttl - the value for the ttl record component
  • Method Details

    • of

      public static <V> BulkOperations.TtlValue<V> of(V value, Duration ttl)
      Creates a TtlValue | 创建 TtlValue
      Type Parameters:
      V - value type | 值类型
      Parameters:
      value - the value | 值
      ttl - the time-to-live | 存活时间
      Returns:
      the TtlValue | TtlValue 实例
    • 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.
    • value

      public V value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component
    • ttl

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