public class ApiKey
extends java.lang.Object
ApiFactory can
be created to generate HTTP network accessors to the LoL API.RiotApi,
ApiFactory| Constructor and Description |
|---|
ApiKey(java.lang.String key,
RateRule... rules)
This constructor is exposed for convenience, but a better approach
to creating
ApiKey instances is to use loadApiKeys() or
loadApiKeys(File) |
| Modifier and Type | Method and Description |
|---|---|
RateRule[] |
getRules() |
TicketBucket |
getTicketBucket(Region region)
Gets the
TicketBucket for the given Region. |
static ApiKey[] |
loadApiKeys()
Read API keys in the file ./API_KEY.
|
static ApiKey[] |
loadApiKeys(java.io.File file)
Read API keys in the given file.
|
java.lang.String |
toString() |
public ApiKey(java.lang.String key,
RateRule... rules)
ApiKey instances is to use loadApiKeys() or
loadApiKeys(File)key - the key string from your developer dashboardrules - the rate rules associated with your key, also on your developer dashboardpublic TicketBucket getTicketBucket(Region region)
TicketBucket for the given Region. Creates
one if it does not exist.region - Region to retrieveTicketBucket for this Regionpublic java.lang.String toString()
toString in class java.lang.Objectpublic static ApiKey[] loadApiKeys() throws java.io.FileNotFoundException
ApiKey found in the ./API_KEY filejava.io.FileNotFoundException - if the ./API_KEY file cannot be foundpublic static ApiKey[] loadApiKeys(java.io.File file) throws java.io.FileNotFoundException
file - API key file to readApiKey found in the specified filejava.io.FileNotFoundException - if the specified file cannot be found