Record Class RateLimiter.RateLimiterConfig
java.lang.Object
java.lang.Record
com.loomcache.server.ratelimit.RateLimiter.RateLimiterConfig
- Enclosing class:
RateLimiter
public static record RateLimiter.RateLimiterConfig(double permitsPerSecond, int burstSize)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionRateLimiterConfig(double permitsPerSecond, int burstSize) Creates an instance of aRateLimiterConfigrecord 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.of(double rate) doubleReturns the value of thepermitsPerSecondrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RateLimiterConfig
public RateLimiterConfig(double permitsPerSecond, int burstSize) Creates an instance of aRateLimiterConfigrecord class.- Parameters:
permitsPerSecond- the value for thepermitsPerSecondrecord componentburstSize- the value for theburstSizerecord component
-
-
Method Details
-
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
-
of
-
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.
-