public class RateRule
extends java.lang.Object
| Constructor and Description |
|---|
RateRule(int requests,
int per,
java.util.concurrent.TimeUnit timeUnit)
Requests / unit-time (e.g.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
static RateRule |
from(java.lang.String string) |
static RateRule[] |
getDevelopmentRates() |
long |
getMilliseconds() |
int |
getPer() |
static RateRule[] |
getProductionRates() |
int |
getRequests() |
java.util.concurrent.TimeUnit |
getTimeUnit() |
java.lang.String |
toString() |
public RateRule(int requests,
int per,
java.util.concurrent.TimeUnit timeUnit)
requests - number of requestsper - count of time unitstimeUnit - time unitpublic int getRequests()
public int getPer()
public java.util.concurrent.TimeUnit getTimeUnit()
public long getMilliseconds()
RateRule
specifiespublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic static RateRule from(java.lang.String string)
string - REQUESTS PER TimeUnit (e.g. 500 10 MINUTES, read as 500 requests per 10 minutes)RateRule with the specified ratejava.lang.IllegalArgumentException - if the given String cannot be parsed or contains invalid valuesjava.lang.NumberFormatException - if the either the requests or per values are not valid integerspublic static RateRule[] getDevelopmentRates()
RateRules 500 10 minutes and 10 10 secondspublic static RateRule[] getProductionRates()
RateRules 180,000 10 MINUTES and 300 10 seconds