Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.robrua.orianna.api.dto;
  
  import java.util.Arrays;
  import java.util.HashMap;
  import java.util.HashSet;
  import java.util.List;
  import java.util.Map;
  import java.util.Set;
 
 
 public abstract class LeagueAPI {
     private static final Set<QueueTypeRANKED_QUEUES = new HashSet<>(Arrays.asList(new QueueType[] {..,
             .}));

    

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) {
         if(!.contains(queueType)) {
             throw new IllegalArgumentException("Can't get challenger for a non-ranked queue type!");
         }
 
         final String request = ..get("league") + "/league/challenger";
         final Map<StringStringparams = new ParamsBuilder().add("type"queueType).build();
         return ..fromJson(BaseRiotAPI.get(requestparamsfalse), League.class);
     }

    

Parameters:
queueType the queue type to get the master league for
Returns:
the master league
See also:
Riot API Specification
 
     public static League getMaster(final QueueType queueType) {
         if(!.contains(queueType)) {
             throw new IllegalArgumentException("Can't get master for a non-ranked queue type!");
         }
 
         final String request = ..get("league") + "/league/master";
         final Map<StringStringparams = new ParamsBuilder().add("type"queueType).build();
         return ..fromJson(BaseRiotAPI.get(requestparamsfalse), League.class);
     }

    

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) {
         if(summonerIDs.isEmpty()) {
             return new HashMap<>();
         }
         if(summonerIDs.size() > 10) {
             throw new IllegalArgumentException("Can't get league entries for more than 10 summoners!");
         }
 
         final String request = ..get("league") + "/league/by-summoner/" + Utils.getIDString(summonerIDs) + "/entry";
         final Type type = new TypeToken<Map<LongList<League>>>() {}.getType();
         return ..fromJson(BaseRiotAPI.get(requestnullfalse), type);
     }

    

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 getSummonerLeagueEntries(Utils.convert(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) {
         if(summonerIDs.isEmpty()) {
            return new HashMap<>();
        }
        if(summonerIDs.size() > 10) {
            throw new IllegalArgumentException("Can't get leagues for more than 10 summoners!");
        }
        final String request = ..get("league") + "/league/by-summoner/" + Utils.getIDString(summonerIDs);
        final Type type = new TypeToken<Map<LongList<League>>>() {}.getType();
        return ..fromJson(BaseRiotAPI.get(requestnullfalse), type);
    }

    

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 getSummonerLeagues(Utils.convert(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) {
        if(teamIDs.isEmpty()) {
            return new HashMap<>();
        }
        if(teamIDs.size() > 10) {
            throw new IllegalArgumentException("Can't get leagues for more than 10 teams!");
        }
        final String request = ..get("league") + "/league/by-team/" + Utils.getIDString(teamIDs) + "/entry";
        final Type type = new TypeToken<Map<StringList<League>>>() {}.getType();
        return ..fromJson(BaseRiotAPI.get(requestnullfalse), type);
    }

    

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 getTeamLeagueEntries(Arrays.asList(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) {
        if(teamIDs.isEmpty()) {
            return new HashMap<>();
        }
        if(teamIDs.size() > 10) {
            throw new IllegalArgumentException("Can't get leagues for more than 10 teams!");
        }
        final String request = ..get("league") + "/league/by-team/" + Utils.getIDString(teamIDs);
        final Type type = new TypeToken<Map<StringList<League>>>() {}.getType();
        return ..fromJson(BaseRiotAPI.get(requestnullfalse), type);
    }

    

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 getTeamLeagues(Arrays.asList(teamIDs));
    }
New to GrepCode? Check out our FAQ X