Package com.jcabi.github
Class Limit.Smart
- java.lang.Object
-
- com.jcabi.github.Limit.Smart
-
- All Implemented Interfaces:
JsonReadable
,Limit
- Enclosing interface:
- Limit
@Immutable @Loggable(1) public static final class Limit.Smart extends Object implements Limit
Smart limits with extra features.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jcabi.github.Limit
Limit.Smart, Limit.Throttled
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Github
github()
Github we're in.javax.json.JsonObject
json()
Describe it in a JSON object.int
limit()
Limit of number of requests.int
remaining()
Remaining number of requests.Date
reset()
When will the limit be reset.
-
-
-
Constructor Detail
-
Smart
public Smart(Limit limit)
Public ctor.- Parameters:
limit
- Limit
-
-
Method Detail
-
limit
public int limit() throws IOException
Limit of number of requests.- Returns:
- Number of requests you can make in total
- Throws:
IOException
- If it fails
-
remaining
public int remaining() throws IOException
Remaining number of requests.- Returns:
- Number of requests you can still make
- Throws:
IOException
- If it fails
-
reset
public Date reset() throws IOException
When will the limit be reset.- Returns:
- Date when this will happen
- Throws:
IOException
- If it fails
-
json
public javax.json.JsonObject json() throws IOException
Description copied from interface:JsonReadable
Describe it in a JSON object.- Specified by:
json
in interfaceJsonReadable
- Returns:
- JSON object
- Throws:
IOException
- If there is any I/O problem
-
-