Record Class RateLimiter.ClientStats
java.lang.Object
java.lang.Record
com.loomcache.server.network.RateLimiter.ClientStats
- Enclosing class:
RateLimiter
-
Constructor Summary
ConstructorsConstructorDescriptionClientStats(String clientId, long requestsAllowed, long requestsDenied, double currentTokens, Instant lastAccessTime) Creates an instance of aClientStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionclientId()Returns the value of theclientIdrecord component.doubleReturns the value of thecurrentTokensrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thelastAccessTimerecord component.longReturns the value of therequestsAllowedrecord component.longReturns the value of therequestsDeniedrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ClientStats
public ClientStats(String clientId, long requestsAllowed, long requestsDenied, double currentTokens, Instant lastAccessTime) Creates an instance of aClientStatsrecord class.- Parameters:
clientId- the value for theclientIdrecord componentrequestsAllowed- the value for therequestsAllowedrecord componentrequestsDenied- the value for therequestsDeniedrecord componentcurrentTokens- the value for thecurrentTokensrecord componentlastAccessTime- the value for thelastAccessTimerecord component
-
-
Method Details
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
clientId
Returns the value of theclientIdrecord component.- Returns:
- the value of the
clientIdrecord component
-
requestsAllowed
public long requestsAllowed()Returns the value of therequestsAllowedrecord component.- Returns:
- the value of the
requestsAllowedrecord component
-
requestsDenied
public long requestsDenied()Returns the value of therequestsDeniedrecord component.- Returns:
- the value of the
requestsDeniedrecord component
-
currentTokens
public double currentTokens()Returns the value of thecurrentTokensrecord component.- Returns:
- the value of the
currentTokensrecord component
-
lastAccessTime
Returns the value of thelastAccessTimerecord component.- Returns:
- the value of the
lastAccessTimerecord component
-