Record Class RateLimitGuard.Storage.AcquireResult
java.lang.Object
java.lang.Record
org.apache.juneau.rest.server.guard.RateLimitGuard.Storage.AcquireResult
- Record Components:
allowed-true if the request was admitted.remaining- Tokens left in the bucket after the attempt.secondsUntilReset- Seconds until the bucket is full again.
- Enclosing interface:
- RateLimitGuard.Storage
public static record RateLimitGuard.Storage.AcquireResult(boolean allowed, int remaining, long secondsUntilReset)
extends Record
Outcome of a
tryAcquire attempt.-
Constructor Summary
ConstructorsConstructorDescriptionAcquireResult(boolean allowed, int remaining, long secondsUntilReset) Creates an instance of aAcquireResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanallowed()Returns the value of theallowedrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of theremainingrecord component.longReturns the value of thesecondsUntilResetrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AcquireResult
Creates an instance of aAcquireResultrecord class.- Parameters:
allowed- the value for theallowedrecord componentremaining- the value for theremainingrecord componentsecondsUntilReset- the value for thesecondsUntilResetrecord 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
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 with '=='. -
allowed
Returns the value of theallowedrecord component.- Returns:
- the value of the
allowedrecord component
-
remaining
Returns the value of theremainingrecord component.- Returns:
- the value of the
remainingrecord component
-
secondsUntilReset
Returns the value of thesecondsUntilResetrecord component.- Returns:
- the value of the
secondsUntilResetrecord component
-