public class RateLimitError
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
RateLimitError.Serializer
For internal use only.
|
Modifier and Type | Field and Description |
---|---|
protected RateLimitReason |
reason |
protected long |
retryAfter |
Constructor and Description |
---|
RateLimitError(RateLimitReason reason)
Error occurred because the app is being rate limited.
|
RateLimitError(RateLimitReason reason,
long retryAfter)
Error occurred because the app is being rate limited.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
RateLimitReason |
getReason()
The reason why the app is being rate limited.
|
long |
getRetryAfter()
The number of seconds that the app should wait before making another
request.
|
int |
hashCode() |
java.lang.String |
toString() |
java.lang.String |
toStringMultiline()
Returns a String representation of this object formatted for easier
readability.
|
protected final RateLimitReason reason
protected final long retryAfter
public RateLimitError(RateLimitReason reason, long retryAfter)
reason
- The reason why the app is being rate limited. Must not be
null
.retryAfter
- The number of seconds that the app should wait before
making another request.java.lang.IllegalArgumentException
- If any argument does not meet its
preconditions.public RateLimitError(RateLimitReason reason)
The default values for unset fields will be used.
reason
- The reason why the app is being rate limited. Must not be
null
.java.lang.IllegalArgumentException
- If any argument does not meet its
preconditions.public RateLimitReason getReason()
null
.public long getRetryAfter()
null
if not present. Defaults to
1L.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringMultiline()
The returned String may contain newlines.