Class RateLimit
java.lang.Object
io.github.jeremylong.openvulnerability.client.ghsa.RateLimit
- All Implemented Interfaces:
Serializable
Represents the client's rate limit.
type RateLimit
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intThe point cost for the current query.private intThe maximum number of points permitted in a 60-minute window.private intThe number of points remaining in the current rate limit window.private ZonedDateTimeThe time at which the current rate limit window resets.private static final longSerialization version UID. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanintgetCost()The point cost for the current query counting against the rate limit.intgetLimit()The maximum number of points the client is permitted to consume in a 60-minute window.intThe number of points remaining in the current rate limit window.The time at which the current rate limit window resets in UTC epoch seconds.inthashCode()toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
limit
private int limitThe maximum number of points permitted in a 60-minute window. -
cost
private int costThe point cost for the current query. -
remaining
private int remainingThe number of points remaining in the current rate limit window. -
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
The time at which the current rate limit window resets in UTC epoch seconds.- Returns:
- the time the rate limit window will reset.
-
toString
-
equals
-
hashCode
public int hashCode()
-