Record Class FixedWindowBuckets.ClockTimeMeter
java.lang.Object
java.lang.Record
com.irurueta.authserver.authorization.api.web.ratelimit.FixedWindowBuckets.ClockTimeMeter
- Record Components:
clock- source of the current time.
- All Implemented Interfaces:
io.github.bucket4j.TimeMeter
- Enclosing class:
FixedWindowBuckets
private static record FixedWindowBuckets.ClockTimeMeter(Clock clock)
extends Record
implements io.github.bucket4j.TimeMeter
Bucket4j and Caffeine time source backed by a
Clock.-
Field Summary
FieldsFields inherited from interface io.github.bucket4j.TimeMeter
SYSTEM_MILLISECONDS, SYSTEM_NANOTIME -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateClockTimeMeter(Clock clock) Creates an instance of aClockTimeMeterrecord class. -
Method Summary
Modifier and TypeMethodDescriptionclock()Returns the value of theclockrecord component.longfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanfinal StringtoString()Returns a string representation of this record class.
-
Field Details
-
clock
The field for theclockrecord component.
-
-
Constructor Details
-
ClockTimeMeter
Creates an instance of aClockTimeMeterrecord class.- Parameters:
clock- the value for theclockrecord component
-
-
Method Details
-
currentTimeNanos
public long currentTimeNanos()- Specified by:
currentTimeNanosin interfaceio.github.bucket4j.TimeMeter
-
isWallClockBased
public boolean isWallClockBased()- Specified by:
isWallClockBasedin interfaceio.github.bucket4j.TimeMeter
-
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). -
clock
Returns the value of theclockrecord component.- Returns:
- the value of the
clockrecord component
-