Record Class AbuseLimitsPolicy.Limit

java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.credential.abuse.AbuseLimitsPolicy.Limit
Record Components:
window - sliding-window length
delayAt - failure count at which AbuseDecision.Delay kicks in, or 0 to disable the delay step
stepUpAt - failure count at which AbuseDecision.RequireAdditionalCheck kicks in, or 0 to disable
blockAt - failure count at which AbuseDecision.Block kicks in, or 0 to disable
delayLen - duration returned with AbuseDecision.Delay
blockLen - duration returned with AbuseDecision.Block
Enclosing class:
AbuseLimitsPolicy

public static record AbuseLimitsPolicy.Limit(Duration window, int delayAt, int stepUpAt, int blockAt, Duration delayLen, Duration blockLen) extends Record
Single sliding-window limit definition.
  • Constructor Details

    • Limit

      public Limit(Duration window, int delayAt, int stepUpAt, int blockAt, Duration delayLen, Duration blockLen)
      Creates an instance of a Limit record class.
      Parameters:
      window - the value for the window record component
      delayAt - the value for the delayAt record component
      stepUpAt - the value for the stepUpAt record component
      blockAt - the value for the blockAt record component
      delayLen - the value for the delayLen record component
      blockLen - the value for the blockLen record component
  • Method Details

    • 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.
    • window

      public Duration window()
      Returns the value of the window record component.
      Returns:
      the value of the window record component
    • delayAt

      public int delayAt()
      Returns the value of the delayAt record component.
      Returns:
      the value of the delayAt record component
    • stepUpAt

      public int stepUpAt()
      Returns the value of the stepUpAt record component.
      Returns:
      the value of the stepUpAt record component
    • blockAt

      public int blockAt()
      Returns the value of the blockAt record component.
      Returns:
      the value of the blockAt record component
    • delayLen

      public Duration delayLen()
      Returns the value of the delayLen record component.
      Returns:
      the value of the delayLen record component
    • blockLen

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