Record Class TtlDecayPolicy.Step

java.lang.Object
java.lang.Record
cloud.opencode.base.cache.ttl.TtlDecayPolicy.Step
Record Components:
threshold - access count threshold | 访问计数阈值
ttl - TTL at this step | 此步骤的 TTL
Enclosing interface:
TtlDecayPolicy

public static record TtlDecayPolicy.Step(long threshold, Duration ttl) extends Record
Step definition for step decay 阶梯衰减的步骤定义
Since:
JDK 25, opencode-base-cache V2.0.5
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • Step

      public Step(long threshold, Duration ttl)
      public Step
  • Method Details

    • of

      public static TtlDecayPolicy.Step of(long threshold, Duration ttl)
      Create a step 创建步骤
      Parameters:
      threshold - access threshold | 访问阈值
      ttl - TTL at this step | 此步骤的 TTL
      Returns:
      step | 步骤
    • 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.
    • threshold

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

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