Package dev.relism.flash.ext.limiter
Record Class LimitConfig
java.lang.Object
java.lang.Record
dev.relism.flash.ext.limiter.LimitConfig
- Record Components:
limit- Maximum allowed requests per window.windowMs- Window duration in milliseconds.strategy- Strategy instance bound to this rule (one per rule, not shared).
Immutable configuration snapshot for a single rate-limit rule.
Created once at boot time and captured directly in the middleware closure.
-
Constructor Summary
ConstructorsConstructorDescriptionLimitConfig(int limit, long windowMs, RateLimitStrategy strategy) Creates an instance of aLimitConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intlimit()Returns the value of thelimitrecord component.strategy()Returns the value of thestrategyrecord component.final StringtoString()Returns a string representation of this record class.longwindowMs()Returns the value of thewindowMsrecord component.
-
Constructor Details
-
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
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
limit
public int limit()Returns the value of thelimitrecord component.- Returns:
- the value of the
limitrecord component
-
windowMs
public long windowMs()Returns the value of thewindowMsrecord component.- Returns:
- the value of the
windowMsrecord component
-
strategy
Returns the value of thestrategyrecord component.- Returns:
- the value of the
strategyrecord component
-