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.
Since:
0.6
  • Constructor Details

    • Smart

      public Smart(Limit limit)
      Public ctor.
      Parameters:
      limit - Limit
  • Method Details

    • 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 jakarta.json.JsonObject json() throws IOException
      Description copied from interface: JsonReadable
      Describe it in a JSON object.
      Specified by:
      json in interface JsonReadable
      Returns:
      JSON object
      Throws:
      IOException - If there is any I/O problem
    • github

      public GitHub github()
      Description copied from interface: Limit
      GitHub we're in.
      Specified by:
      github in interface Limit
      Returns:
      GitHub