Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   package com.robrua.orianna.api.dto;
   
   import java.io.IOException;
   import java.io.InputStream;
   import java.net.URI;
   import java.util.ArrayList;
   import java.util.Collection;
   import java.util.Date;
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  
  
Queries the LoL REST API for information, returning Java objects matching the exact API spec

Author(s):
Rob Rua (FatalElement - NA) (robrua@alumni.cmu.edu)
  
  public abstract class BaseRiotAPI {
      static final Map<StringStringAPI_VERSIONS;
      private static String APIKey;
      private static CloseableHttpClient CLIENT = HttpClients.createDefault();
      static final Gson GSON = new GsonBuilder().registerTypeAdapter(ChampionSpell.classnew ChampionSpellDeserializer())
              .registerTypeAdapter(SummonerSpell.classnew SummonerSpellDeserializer()).create();
      static Region mirrorregion;
      private static boolean printCalls = false;
      private static HttpHost proxy;
      private static RateLimiter rateLimiter = RiotAPI.getDefaultDevelopmentRateLimiter();
  
      static {
           = new HashMap<>();
          .put("champion""v1.2");
          .put("current-game""v1.0");
          .put("featured-games""v1.0");
          .put("game""v1.3");
          .put("league""v2.5");
          .put("static-data""v1.2");
          .put("status""v1.0");
          .put("match""v2.2");
          .put("matchhistory""v2.2");
          .put("stats""v1.3");
          .put("summoner""v1.4");
          .put("team""v2.4");
          .put("challenge""v4.1");
      }

    
Consumes the entity, closing resources

Parameters:
entity the entity to consume
Throws:
java.io.IOException
 
     private static void consume(final HttpEntity entitythrows IOException {
         if(entity == null) {
             return;
         }
         if(entity.isStreaming()) {
             final InputStream instream = entity.getContent();
             if(instream != null) {
                 instream.close();
             }
         }
     }

    
Uses Apache HttpClient to make a GET request to the server and return the JSON response. Blocks if necessary to meet rate limits. Throws an APIException if the server sends an error code.

Parameters:
request the latter part of the request (everything following /api/lol/ but without params)
params the parameters to use for the request. API Key is automatically added in this method.
staticServer whether to query the static data sever or not (regional server)
Returns:
the JSON response from the API
 
     static String get(final String requestfinal Map<StringStringparamsfinal boolean staticServer) {
         // Check that mirror, region, and API key are set
         if( == null) {
             throw new OriannaException("Must set region for the API using setRegion before the server can be queried!");
         }
         if( == null) {
             throw new OriannaException("Must set mirror for the API using setRegion before the server can be queried!");
         }
         if( == null) {
             throw new OriannaException("Must set API key for using setAPIKey before the server can be queried!");
         }
 
         // Convert params for Apache HTTP
         final List<NameValuePairparam = new ArrayList<>();
         param.add(new BasicNameValuePair("api_key"));
 
         if(params != null) {
             for(final String name : params.keySet()) {
                 param.add(new BasicNameValuePair(nameparams.get(name)));
             }
         }
 
         // Build URI for request
         final String server = staticServer ? "global" : .toString().toLowerCase();
         final String rgn = staticServer ? "static-data/" + .toString().toLowerCase() : .toString().toLowerCase();
 
         // Make request
         try {
             final URI uri = new URIBuilder().setScheme("https").setHost(server + ".api.pvp.net").setPath("/api/lol/" + rgn + "/" + request)
                     .setParameters(param).build();
             return get(uristaticServer);
         }
         catch(final URISyntaxException e) {
             throw new OriannaException("Generated http request wasn't valid! Report this to the Orianna team.");
         }
     }

    
Uses Apache HttpClient to make a GET request to the server and return the JSON response. Blocks if necessary to meet rate limits. Throws an APIException if the server sends an error code.

Parameters:
uri the URI to send the request to
staticServer whether to query the static data sever or not (regional server)
Returns:
the JSON response from the API
 
     static String get(final URI urifinal boolean staticServer) {
         // Wait for a call to be available if this is a call to a rate
         // limited server
         if(!staticServer) {
             .waitForCall();
         }
 
         boolean registered = false;
 
         // Send request to Riot and register call
         try {
             final HttpGet get = new HttpGet(uri);
             if( != null) {
                 final RequestConfig config = RequestConfig.custom().setProxy().build();
                 get.setConfig(config);
             }
 
             if() {
                 ..println(uri);
             }
 
             final CloseableHttpResponse response = .execute(get);
             try {
                 final HttpEntity entity = response.getEntity();
                 final String content = EntityUtils.toString(entity);
                 consume(entity);
 
                 // Handle API errors
                 if(response.getStatusLine().getStatusCode() == 429) {
                     // Force rate limiter to wait after a 429
                     final int retryAfter = Integer.parseInt(response.getFirstHeader("Retry-After").getValue()) + 1;
                     .resetIn(retryAfter * 1000L);
 
                     // Release resources and exit from rate limited call, then
                     // retry call
                     response.close();
                     .registerCall();
                     registered = true;
                     return get(uristaticServer);
                 }
                 else if(response.getStatusLine().getStatusCode() != 200) {
                     throw new APIException(uri.toString(), response.getStatusLine().getStatusCode());
                 }
 
                 return content;
             }
             finally {
                 if(!registered) {
                     response.close();
                 }
             }
         }
         catch(final IOException e) {
             throw new OriannaException("Request to Riot server failed! Report this to the Orianna team.");
         }
         finally {
             if(!staticServer && !registered) {
                 .registerCall();
             }
         }
     }

    

Parameters:
queueType the queue type to get the challenger league for
Returns:
the challenger league
See also:
Riot API Specification
 
     public static League getChallenger(final QueueType queueType) {
         return LeagueAPI.getChallenger(queueType);
     }

    

Parameters:
ID the champion's ID
Returns:
the champion
See also:
Riot API Specification
 
     public static com.robrua.orianna.type.dto.staticdata.Champion getChampion(final long ID) {
         return StaticDataAPI.getChampion(ID);
     }

    

Returns:
the list all of champions
See also:
Riot API Specification
 
         return StaticDataAPI.getChampions();
     }

    

Parameters:
ID the ID of the champion to look up
Returns:
the champion
See also:
Riot API Specification
 
     public static com.robrua.orianna.type.dto.champion.Champion getChampionStatus(final long ID) {
         return ChampionAPI.getChampionStatus(ID);
     }

    

Parameters:
freeToPlay whether to only return free champions
Returns:
all champions
See also:
Riot API Specification
 
     public static com.robrua.orianna.type.dto.champion.ChampionList getChampionStatuses(final boolean freeToPlay) {
         return ChampionAPI.getChampionStatuses(freeToPlay);
     }

    

Parameters:
summonerID summoner to look up current game for
Returns:
the summoner's current game
See also:
Riot API Specification
 
     public static CurrentGameInfo getCurrentGame(final long summonerID) {
         return CurrentGameAPI.getCurrentGame(summonerID);
     }

    

Returns:
the featured games
See also:
Riot API Specification
 
     public static FeaturedGames getFeaturedGames() {
         return FeaturedGamesAPI.getFeaturedGames();
     }

    

Parameters:
ID the item's ID
Returns:
the item
See also:
Riot API Specification
 
     public static Item getItem(final long ID) {
         return StaticDataAPI.getItem(ID);
     }

    

Returns:
the list of all items
See also:
Riot API Specification
 
     public static ItemList getItems() {
         return StaticDataAPI.getItems();
     }

    

Returns:
the languages
See also:
Riot API Specification
 
     public static List<StringgetLanguages() {
         return StaticDataAPI.getLanguages();
     }

    

Returns:
the language strings
See also:
Riot API Specification
 
     public static LanguageStrings getLanguageStrings() {
         return StaticDataAPI.getLanguageStrings();
     }

    

Returns:
the map information
See also:
Riot API Specification
 
     public static MapData getMapInformation() {
         return StaticDataAPI.getMapInformation();
     }

    

Returns:
the list of all masteries
See also:
Riot API Specification
 
     public static MasteryList getMasteries() {
         return StaticDataAPI.getMasteries();
     }

    

Parameters:
ID the mastery's ID
Returns:
the mastery
See also:
Riot API Specification
 
     public static Mastery getMastery(final long ID) {
         return StaticDataAPI.getMastery(ID);
     }

    

Parameters:
ID the ID of the match to look up
Returns:
the match
See also:
Riot API Specification
 
     public static MatchDetail getMatch(final long ID) {
         return MatchAPI.getMatch(ID);
     }

    
Gets the 15 most recent matches for the summoner

Parameters:
summonerID the ID of the summoner to get match history for
Returns:
the match history for that summoner
See also:
Riot API Specification
 
     public static PlayerHistory getMatchHistory(final long summonerID) {
         return MatchHistoryAPI.getMatchHistory(summonerID);
     }

    
Gets the 15 most recent matches after beginIndex for the summoner

Parameters:
summonerID the ID of the summoner to get match history for
beginIndex the game index to start from
Returns:
the match history for that summoner
See also:
Riot API Specification
 
     public static PlayerHistory getMatchHistory(final long summonerIDfinal int beginIndex) {
         return MatchHistoryAPI.getMatchHistory(summonerIDbeginIndex);
     }

    
Gets the 15 most recent matches after beginIndex for the summoner

Parameters:
summonerID the ID of the summoner to get match history for
beginIndex the game index to start from
championIDs the champions to limit games to
Returns:
the match history for that summoner
See also:
Riot API Specification
 
     public static PlayerHistory getMatchHistory(final long summonerIDfinal int beginIndexfinal List<LongchampionIDs) {
         return MatchHistoryAPI.getMatchHistory(summonerIDbeginIndexchampionIDs);
     }

    
Gets the 15 most recent matches after beginIndex for the summoner

Parameters:
summonerID the ID of the summoner to get match history for
beginIndex the game index to start from
queueType the queue type to limit games to (only ranked queues)
Returns:
the match history for that summoner
See also:
Riot API Specification
 
     public static PlayerHistory getMatchHistory(final long summonerIDfinal int beginIndexfinal QueueType queueType) {
         return MatchHistoryAPI.getMatchHistory(summonerIDbeginIndexqueueType);
     }

    
Gets the 15 most recent matches after beginIndex for the summoner

Parameters:
summonerID the ID of the summoner to get match history for
beginIndex the game index to start from
queueType the queue type to limit games to (only ranked queues)
championIDs the champions to limit games to
Returns:
the match history for that summoner
See also:
Riot API Specification
 
     public static PlayerHistory getMatchHistory(final long summonerIDfinal int beginIndexfinal QueueType queueTypefinal List<LongchampionIDs) {
         return MatchHistoryAPI.getMatchHistory(summonerIDbeginIndexqueueTypechampionIDs);
     }

    
Gets the 15 most recent matches for the summoner

Parameters:
summonerID the ID of the summoner to get match history for
championIDs the champions to limit games to
Returns:
the match history for that summoner
See also:
Riot API Specification
 
     public static PlayerHistory getMatchHistory(final long summonerIDfinal List<LongchampionIDs) {
         return MatchHistoryAPI.getMatchHistory(summonerIDchampionIDs);
     }

    
Gets the 15 most recent matches for the summoner

Parameters:
summonerID the ID of the summoner to get match history for
queueType the queue type to limit games to (only ranked queues)
Returns:
the match history for that summoner
See also:
Riot API Specification
 
     public static PlayerHistory getMatchHistory(final long summonerIDfinal QueueType queueType) {
         return MatchHistoryAPI.getMatchHistory(summonerIDqueueType);
     }

    
Gets the 15 most recent matches for the summoner

Parameters:
summonerID the ID of the summoner to get match history for
queueType the queue type to limit games to (only ranked queues)
championIDs the champions to limit games to
Returns:
the match history for that summoner
See also:
Riot API Specification
 
     public static PlayerHistory getMatchHistory(final long summonerIDfinal QueueType queueTypefinal List<LongchampionIDs) {
         return MatchHistoryAPI.getMatchHistory(summonerIDqueueTypechampionIDs);
     }

    

Parameters:
summonerID the ID of the summoner to get ranked stats for
Returns:
the ranked stats for that summoner
See also:
Riot API Specification
 
     public static RankedStats getRankedStats(final long summonerID) {
         return StatsAPI.getRankedStats(summonerID);
     }

    

Parameters:
summonerID the ID of the summoner to get ranked stats for
season the season to get stats for
Returns:
the ranked stats for that summoner
See also:
Riot API Specification
 
     public static RankedStats getRankedStats(final long summonerIDfinal Season season) {
         return StatsAPI.getRankedStats(summonerIDseason);
     }

    

Returns:
the realm
See also:
Riot API Specification
 
     public static Realm getRealm() {
         return StaticDataAPI.getRealm();
     }

    

Parameters:
summonerID the ID of the summoner to look up recent games for
Returns:
the summoner's recent games
See also:
Riot API Specification
 
     public static RecentGames getRecentGames(final long summonerID) {
         return GameAPI.getRecentGames(summonerID);
     }

    
Uses Apache HttpClient to make a GET request to the server and return the JSON response. Blocks if necessary to meet rate limits. Throws an APIException if the server sends an error code.

Parameters:
request the latter part of the request (everything following the host)
params the parameters to use for the request. API Key is automatically added in this method.
staticServer whether to query the static data sever or not (regional server)
Returns:
the JSON response from the API
 
     static String getRoot(final String requestfinal Map<StringStringparamsfinal boolean staticServer) {
         // Check that mirror, region, and API key are set
         if( == null) {
             throw new OriannaException("Must set mirror for the API using setRegion before the server can be queried!");
         }
         if( == null) {
             throw new OriannaException("Must set API key for using setAPIKey before the server can be queried!");
         }
 
         // Convert params for Apache HTTP
         final List<NameValuePairparam = new ArrayList<>();
         param.add(new BasicNameValuePair("api_key"));
 
         if(params != null) {
             for(final String name : params.keySet()) {
                 param.add(new BasicNameValuePair(nameparams.get(name)));
             }
         }
 
         // Make request
         try {
             final String server = staticServer ? "global" : .toString().toLowerCase();
             final URI uri = new URIBuilder().setScheme("https").setHost(server + ".api.pvp.net").setPath(request).setParameters(param).build();
             return get(uristaticServer);
         }
         catch(final URISyntaxException e) {
             throw new OriannaException("Generated http request wasn't valid! Report this to the Orianna team.");
         }
     }

    

Parameters:
ID the rune's ID
Returns:
the rune
See also:
Riot API Specification
 
     public static Rune getRune(final long ID) {
         return StaticDataAPI.getRune(ID);
     }

    

Returns:
the list of all runes
See also:
Riot API Specification
 
     public static RuneList getRunes() {
         return StaticDataAPI.getRunes();
     }

    

Parameters:
region the region's shard to get
Returns:
the shard
See also:
Riot API Specification
 
     public static ShardStatus getShard(final Region region) {
         return StatusAPI.getShard(region);
     }

    

Returns:
the list of all shards
See also:
Riot API Specification
 
     public static List<ShardgetShards() {
         return StatusAPI.getShards();
     }

    

Parameters:
summonerID the ID of the summoner to get stats for
Returns:
the stats for that summoner
See also:
Riot API Specification
 
     public static PlayerStatsSummaryList getStats(final long summonerID) {
         return StatsAPI.getStats(summonerID);
     }

    

Parameters:
summonerID the ID of the summoner to get stats for
season the season to get stats for
Returns:
the stats for that summoner
See also:
Riot API Specification
 
     public static PlayerStatsSummaryList getStats(final long summonerIDfinal Season season) {
         return StatsAPI.getStats(summonerIDseason);
     }

    

Parameters:
summonerIDs the summoners to get league entries for
Returns:
the summoners' league entries
See also:
Riot API Specification
 
     public static Map<LongList<League>> getSummonerLeagueEntries(final List<LongsummonerIDs) {
         return LeagueAPI.getSummonerLeagueEntries(summonerIDs);
     }

    

Parameters:
summonerIDs the summoners to get league entries for
Returns:
the summoners' league entries
See also:
Riot API Specification
 
     public static Map<LongList<League>> getSummonerLeagueEntries(final long... summonerIDs) {
         return LeagueAPI.getSummonerLeagueEntries(summonerIDs);
     }

    

Parameters:
summonerIDs the summoners to get leagues for
Returns:
the summoners' league
See also:
Riot API Specification
 
     public static Map<LongList<League>> getSummonerLeagues(final List<LongsummonerIDs) {
         return LeagueAPI.getSummonerLeagues(summonerIDs);
     }

    

Parameters:
summonerIDs the summoners to get leagues for
Returns:
the summoners' league
See also:
Riot API Specification
 
     public static Map<LongList<League>> getSummonerLeagues(final long... summonerIDs) {
         return LeagueAPI.getSummonerLeagues(summonerIDs);
     }

    

Parameters:
summonerIDs the IDs of the summoners to get
Returns:
the summoners
See also:
Riot API Specification
 
     public static Map<LongSummonergetSummonersByID(final List<LongsummonerIDs) {
         return SummonerAPI.getSummonersByID(summonerIDs);
     }

    

Parameters:
summonerIDs the IDs of the summoners to get
Returns:
the summoners
See also:
Riot API Specification
 
     public static Map<LongSummonergetSummonersByID(final long... summonerIDs) {
         return SummonerAPI.getSummonersByID(summonerIDs);
     }

    

Parameters:
summonerNames the names of the summoners to get
Returns:
the summoners
See also:
Riot API Specification
 
     public static Map<StringSummonergetSummonersByName(final List<StringsummonerNames) {
         return SummonerAPI.getSummonersByName(summonerNames);
     }

    

Parameters:
summonerNames the names of the summoners to get
Returns:
the summoners
See also:
Riot API Specification
 
     public static Map<StringSummonergetSummonersByName(final String... summonerNames) {
         return SummonerAPI.getSummonersByName(summonerNames);
     }

    

Parameters:
summonerIDs the IDs of the summoners to get masteries for
Returns:
the summoners' masteries
See also:
Riot API Specification
 
     public static Map<LongMasteryPagesgetSummonersMasteries(final List<LongsummonerIDs) {
         return SummonerAPI.getSummonersMasteries(summonerIDs);
     }

    

Parameters:
summonerIDs the IDs of the summoners to get masteries for
Returns:
the summoners' masteries
See also:
Riot API Specification
 
     public static Map<LongMasteryPagesgetSummonersMasteries(final long... summonerIDs) {
         return SummonerAPI.getSummonersMasteries(summonerIDs);
     }

    

Parameters:
summonerIDs the IDs of the summoners to get names of
Returns:
the summoners' names
See also:
Riot API Specification
 
     public static Map<LongStringgetSummonersNames(final List<LongsummonerIDs) {
         return SummonerAPI.getSummonersNames(summonerIDs);
     }

    

Parameters:
summonerIDs the IDs of the summoners to get names of
Returns:
the summoners' names
See also:
Riot API Specification
 
     public static Map<LongStringgetSummonersNames(final long... summonerIDs) {
         return SummonerAPI.getSummonersNames(summonerIDs);
     }

    

Parameters:
ID the summoner spell's ID
Returns:
the summoner spell
See also:
Riot API Specification
 
     public static SummonerSpell getSummonerSpell(final long ID) {
         return StaticDataAPI.getSummonerSpell(ID);
     }

    

Returns:
the list of all summoner spells
See also:
Riot API Specification
 
     public static SummonerSpellList getSummonerSpells() {
         return StaticDataAPI.getSummonerSpells();
     }

    

Parameters:
summonerIDs the IDs of the summoners to get runes for
Returns:
the summoners' runes
See also:
Riot API Specification
 
     public static Map<LongRunePagesgetSummonersRunes(final List<LongsummonerIDs) {
         return SummonerAPI.getSummonersRunes(summonerIDs);
     }

    

Parameters:
summonerIDs the IDs of the summoners to get runes for
Returns:
the summoners' runes
See also:
Riot API Specification
 
     public static Map<LongRunePagesgetSummonersRunes(final long... summonerIDs) {
         return SummonerAPI.getSummonersRunes(summonerIDs);
     }

    

Parameters:
teamIDs the summoners to get leagues for
Returns:
the team's leagues
See also:
Riot API Specification
 
     public static Map<StringList<League>> getTeamLeagueEntries(final List<StringteamIDs) {
         return LeagueAPI.getTeamLeagueEntries(teamIDs);
     }

    

Parameters:
teamIDs the summoners to get leagues for
Returns:
the team's leagues
See also:
Riot API Specification
 
     public static Map<StringList<League>> getTeamLeagueEntries(final String... teamIDs) {
         return LeagueAPI.getTeamLeagueEntries(teamIDs);
     }

    

Parameters:
teamIDs the summoners to get leagues for
Returns:
the team's leagues
See also:
Riot API Specification
 
     public static Map<StringList<League>> getTeamLeagues(final List<StringteamIDs) {
         return LeagueAPI.getTeamLeagues(teamIDs);
     }

    

Parameters:
teamIDs the summoners to get leagues for
Returns:
the team's leagues
See also:
Riot API Specification
 
     public static Map<StringList<League>> getTeamLeagues(final String... teamIDs) {
         return LeagueAPI.getTeamLeagues(teamIDs);
     }

    

Parameters:
IDs the IDs of the teams
Returns:
the teams
See also:
Riot API Specification
 
     public static Map<StringTeamgetTeamsByID(final List<StringIDs) {
         return TeamAPI.getTeamsByID(IDs);
     }

    

Parameters:
IDs the IDs of the teams
Returns:
the teams
See also:
Riot API Specification
 
     public static Map<StringTeamgetTeamsByID(final String... IDs) {
         return TeamAPI.getTeamsByID(IDs);
     }

    

Parameters:
summonerIDs the IDs of the summoners to get teams for
Returns:
the summoners' teams
See also:
Riot API Specification
 
     public static Map<LongList<Team>> getTeamsBySummoner(final List<LongsummonerIDs) {
         return TeamAPI.getTeamsBySummoner(summonerIDs);
     }

    

Parameters:
summonerIDs the IDs of the summoners to get teams for
Returns:
the summoners' teams
See also:
Riot API Specification
 
     public static Map<LongList<Team>> getTeamsBySummoner(final long... summonerIDs) {
         return TeamAPI.getTeamsBySummoner(summonerIDs);
     }

    

Parameters:
bucketStartTime the start time for the 5-minute bucket to query
Returns:
randomized match IDs from that bucket
See also:
Riot API Specification
    public static List<LonggetURFMatchIDs(final Date bucketStartTime) {
        return ChallengeAPI.getURFMatchIDs(bucketStartTime);
    }

    

Parameters:
bucketStartTime the start time for the 5-minute bucket to query (in epoch seconds)
Returns:
randomized match IDs from that bucket
See also:
Riot API Specification
    public static List<LonggetURFMatchIDs(final long bucketStartTime) {
        return ChallengeAPI.getURFMatchIDs(bucketStartTime);
    }

    

Returns:
the versions
See also:
Riot API Specification
    public static List<StringgetVersions() {
        return StaticDataAPI.getVersions();
    }

    
If turned on, prints the URI of calls made to stdout

Parameters:
on whether to print the URI of calls to stdout
    public static void printCalls(final boolean on) {
         = on;
    }

    
Removes any set proxy
    public static void removeProxy() {
         = null;
    }

    
Sets the API Key to use for queries

Parameters:
newAPIKey the API Key to use for queries
    public static void setAPIKey(final String newAPIKey) {
         = newAPIKey;
    }

    
Sets the server mirror to hit for queries

Parameters:
newMirror the server mirror to hit for queries
    public static void setMirror(final Region newMirror) {
         = newMirror;
    }

    
Sets the proxy to access the API through

Parameters:
IP the IP address of the proxy server
port the working port for the proxy server
    public static void setProxy(final String IPfinal int port) {
         = new HttpHost(IPport);
    }

    
Sets multiple new rate limits for the API, removing any old ones

Parameters:
limits the rate limits to apply
    public static void setRateLimit(final Collection<RateLimitlimits) {
         = new MultiRateLimiter(limits);
    }

    
Sets a new rate limit for the API, removing any old ones

Parameters:
callsPerEpoch the number of calls allowed in each epoch
secondsPerEpoch the number of seconds in each epoch
    public static void setRateLimit(final int callsPerEpochfinal int secondsPerEpoch) {
         = new SingleRateLimiter(callsPerEpochsecondsPerEpoch);
    }

    
Sets a new rate limit for the API, removing any old ones

Parameters:
limit the rate limit
    public static void setRateLimit(final RateLimit limit) {
         = new SingleRateLimiter(limit);
    }

    
Sets multiple new rate limits for the API, removing any old ones

Parameters:
limits the rate limits to apply
    public static void setRateLimit(final RateLimit... limits) {
         = new MultiRateLimiter(limits);
    }

    
Sets the region to get information from the API for

Parameters:
newRegion the region to get information from the API for
    public static void setRegion(final Region newRegion) {
         = newRegion;
    }
New to GrepCode? Check out our FAQ X