java.lang.Object
java.lang.Record
me.ahoo.cosid.time.ClockRegressionPolicy
- Record Components:
borrowUpTo- the largest regression issued on the last time unitwaitUpTo- the largest regression waited out
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final ClockRegressionPolicystatic final ClockRegressionPolicy -
Constructor Summary
ConstructorsConstructorDescriptionClockRegressionPolicy(Duration borrowUpTo, Duration waitUpTo) Creates an instance of aClockRegressionPolicyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theborrowUpTorecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.waitUpTo()Returns the value of thewaitUpTorecord component.
-
Field Details
-
DEFAULT
-
FAIL
-
-
Constructor Details
-
ClockRegressionPolicy
Creates an instance of aClockRegressionPolicyrecord class.- Parameters:
borrowUpTo- the value for theborrowUpTorecord componentwaitUpTo- the value for thewaitUpTorecord component
-
-
Method Details
-
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. -
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. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
borrowUpTo
Returns the value of theborrowUpTorecord component.- Returns:
- the value of the
borrowUpTorecord component
-
waitUpTo
Returns the value of thewaitUpTorecord component.- Returns:
- the value of the
waitUpTorecord component
-