|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.degreedays.api.RateLimit
public final class RateLimit
A snapshot of an API account's rate limit.
The real state of an account's rate limit changes over time and as more
requests are made to the API. So a RateLimit
object, which is a
snapshot, is best checked soon after it is received. It is accessible through
the metadata that is included with each API
Response
and with each RequestFailureException
.
Instances of this class are immutable. You can safely reuse them and call them from multiple threads at once.
Nested Class Summary | |
---|---|
static class |
RateLimit.Builder
A builder class for creating immutable RateLimit objects
e.g. for testing purposes. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Returns true if o is a RateLimit
object with equal properties. |
int |
hashCode()
Overridden to ensure consistency with equals . |
int |
minutesToReset()
Returns the number of minutes until the rate limit is reset, at the time that this snapshot of the rate-limit state was taken. |
int |
requestUnitsAvailable()
Returns the number of request units available for use before the next reset, at the time that this snapshot of the rate-limit state was taken. |
java.lang.String |
toString()
Returns a non-null, non-empty string representation of this object for logging and debugging purposes. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public int requestUnitsAvailable()
public int minutesToReset()
public boolean equals(java.lang.Object o)
true
if o
is a RateLimit
object with equal properties.
equals
in class java.lang.Object
public java.lang.String toString()
The exact details of the representation are unspecified and subject to change.
toString
in class java.lang.Object
public int hashCode()
equals
.
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |