Record Class ClockRegressionPolicy

java.lang.Object
java.lang.Record
me.ahoo.cosid.time.ClockRegressionPolicy
Record Components:
borrowUpTo - the largest regression issued on the last time unit
waitUpTo - the largest regression waited out

public record ClockRegressionPolicy(Duration borrowUpTo, Duration waitUpTo) extends Record
What a time-based generator does when the clock goes back (03-core-model.md ยง4): up to borrowUpTo it keeps issuing in the last time unit (borrowing from the future), up to waitUpTo it waits, beyond that it throws ClockBackwardsException. waitUpTo also bounds the wait for a renewal at the slot window ceiling.
  • Field Details

  • Constructor Details

    • ClockRegressionPolicy

      public ClockRegressionPolicy(Duration borrowUpTo, Duration waitUpTo)
      Creates an instance of a ClockRegressionPolicy record class.
      Parameters:
      borrowUpTo - the value for the borrowUpTo record component
      waitUpTo - the value for the waitUpTo 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. 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.
    • borrowUpTo

      public Duration borrowUpTo()
      Returns the value of the borrowUpTo record component.
      Returns:
      the value of the borrowUpTo record component
    • waitUpTo

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