Record Class PerClientRateLimiter.PerClientConfig
java.lang.Object
java.lang.Record
com.loomcache.server.ratelimit.PerClientRateLimiter.PerClientConfig
- Enclosing class:
PerClientRateLimiter
public static record PerClientRateLimiter.PerClientConfig(double permitsPerSecond, int burstSize, int maxClients)
extends Record
Configuration for per-client rate limiters.
-
Constructor Summary
ConstructorsConstructorDescriptionPerClientConfig(double permitsPerSecond, int burstSize, int maxClients) Creates an instance of aPerClientConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theburstSizerecord 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 themaxClientsrecord component.doubleReturns the value of thepermitsPerSecondrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PerClientConfig
public PerClientConfig(double permitsPerSecond, int burstSize, int maxClients) Creates an instance of aPerClientConfigrecord class.- Parameters:
permitsPerSecond- the value for thepermitsPerSecondrecord componentburstSize- the value for theburstSizerecord componentmaxClients- the value for themaxClientsrecord 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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
permitsPerSecond
public double permitsPerSecond()Returns the value of thepermitsPerSecondrecord component.- Returns:
- the value of the
permitsPerSecondrecord component
-
burstSize
public int burstSize()Returns the value of theburstSizerecord component.- Returns:
- the value of the
burstSizerecord component
-
maxClients
public int maxClients()Returns the value of themaxClientsrecord component.- Returns:
- the value of the
maxClientsrecord component
-