java.lang.Object
io.github.jeremylong.openvulnerability.client.ghsa.RateLimit
All Implemented Interfaces:
Serializable

public class RateLimit extends Object implements Serializable
Represents the client's rate limit.
 type RateLimit
 
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int
    The point cost for the current query.
    private int
    The maximum number of points permitted in a 60-minute window.
    private int
    The number of points remaining in the current rate limit window.
    The time at which the current rate limit window resets.
    private static final long
    Serialization version UID.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
    The point cost for the current query counting against the rate limit.
    int
    The maximum number of points the client is permitted to consume in a 60-minute window.
    int
    The number of points remaining in the current rate limit window.
    The time at which the current rate limit window resets in UTC epoch seconds.
    int
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version UID.
      See Also:
    • limit

      private int limit
      The maximum number of points permitted in a 60-minute window.
    • cost

      private int cost
      The point cost for the current query.
    • remaining

      private int remaining
      The number of points remaining in the current rate limit window.
    • resetAt

      private ZonedDateTime resetAt
      The time at which the current rate limit window resets.
  • Constructor Details

    • RateLimit

      public RateLimit()
  • Method Details

    • getLimit

      public int getLimit()
      The maximum number of points the client is permitted to consume in a 60-minute window.
      Returns:
      the limit.
    • getCost

      public int getCost()
      The point cost for the current query counting against the rate limit.
      Returns:
      the cost.
    • getRemaining

      public int getRemaining()
      The number of points remaining in the current rate limit window.
      Returns:
      the remaining points.
    • getResetAt

      public ZonedDateTime getResetAt()
      The time at which the current rate limit window resets in UTC epoch seconds.
      Returns:
      the time the rate limit window will reset.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object