Package org.kohsuke.github
Class GHRateLimit.Record
- java.lang.Object
-
- org.kohsuke.github.GHRateLimit.Record
-
- Direct Known Subclasses:
GHRateLimit.UnknownLimitRecord
- Enclosing class:
- GHRateLimit
public static class GHRateLimit.Record extends Object
A rate limit record.- Since:
- 1.100
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)intgetLimit()Gets the total number of API calls per hour allotted for this connection.intgetRemaining()Gets the remaining number of requests allowed before this connection will be throttled.DategetResetDate()Returns the date at which the rate limit will reset.longgetResetEpochSeconds()Gets the time in epoch seconds when the rate limit will reset.inthashCode()booleanisExpired()Whether the rate limit reset date indicated by this instance is in theStringtoString()
-
-
-
Constructor Detail
-
Record
public Record(int limit, int remaining, long resetEpochSeconds)Instantiates a new Record.- Parameters:
limit- the limitremaining- the remainingresetEpochSeconds- the reset epoch seconds
-
Record
public Record(int limit, int remaining, long resetEpochSeconds, String updatedAt)Instantiates a new Record.- Parameters:
limit- the limitremaining- the remainingresetEpochSeconds- the reset epoch secondsupdatedAt- the updated at
-
-
Method Detail
-
getRemaining
public int getRemaining()
Gets the remaining number of requests allowed before this connection will be throttled.- Returns:
- an integer
-
getLimit
public int getLimit()
Gets the total number of API calls per hour allotted for this connection.- Returns:
- an integer
-
getResetEpochSeconds
public long getResetEpochSeconds()
Gets the time in epoch seconds when the rate limit will reset.- Returns:
- a long
-
isExpired
public boolean isExpired()
Whether the rate limit reset date indicated by this instance is in the- Returns:
- true if the rate limit reset date has passed. Otherwise false.
-
getResetDate
@Nonnull public Date getResetDate()
Returns the date at which the rate limit will reset.- Returns:
- the calculated date at which the rate limit has or will reset.
-
-