Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.robrua.orianna.api.core;
  
  import java.util.Arrays;
  import java.util.HashSet;
  import java.util.List;
  import java.util.Map;
  import java.util.Set;
 
 
 public abstract class LeagueAPI {
    

Parameters:
queueType the ranked queue type to get the challenger league of
Returns:
the challenger league
 
     public static League getChallenger(final QueueType queueType) {
         final com.robrua.orianna.type.dto.league.League league = BaseRiotAPI.getChallenger(queueType);
 
         if(. == .) {
             RiotAPI.getSummonersByID(new ArrayList<>(league.getSummonerIDs()));
             RiotAPI.getTeams(new ArrayList<>(league.getTeamIDs()));
         }
 
         return new League(league);
     }

    

Parameters:
summoners the summoners to get league entries for
Returns:
the summoners' league entries
 
     public static List<List<League>> getLeagueEntriesBySummoner(final List<Summonersummoners) {
         final List<LongIDs = new ArrayList<>();
         for(final Summoner summoner : summoners) {
             IDs.add(summoner.getID());
         }
 
         return getLeagueEntriesBySummonerID(IDs);
     }

    

Parameters:
summoners the summoners to get league entries for
Returns:
the summoners' league entries
 
     public static List<List<League>> getLeagueEntriesBySummoner(final Summoner... summoners) {
         final List<LongIDs = new ArrayList<>();
         for(final Summoner summoner : summoners) {
             IDs.add(summoner.getID());
         }
 
         return getLeagueEntriesBySummonerID(IDs);
     }

    

Parameters:
summoner the summoner to get league entries for
Returns:
the summoner's league entries
 
     public static List<LeaguegetLeagueEntriesBySummoner(final Summoner summoner) {
         return getLeagueEntriesBySummonerID(summoner.getID());
     }

    

Parameters:
summonerIDs the IDs of the summoners to get league entries for
Returns:
the summoners' league entries
 
     public static List<List<League>> getLeagueEntriesBySummonerID(final List<LongsummonerIDs) {
         if(summonerIDs.isEmpty()) {
             return Collections.emptyList();
         }
 
         final List<List<League>> leagues = new ArrayList<>();
         final Set<LongsumIDs = new HashSet<>();
         final Set<StringteamIDs = new HashSet<>();
         for(final List<Longget : Utils.breakUpList(summonerIDs, 10)) {
             final Map<LongList<com.robrua.orianna.type.dto.league.League>> leg = BaseRiotAPI.getSummonerLeagueEntries(get);
             for(final Long ID : get) {
                 final List<Leaguelgs = new ArrayList<>();
                 if(leg.get(ID) != null) {
                     for(final com.robrua.orianna.type.dto.league.League l : leg.get(ID)) {
                         sumIDs.addAll(l.getSummonerIDs());
                         teamIDs.addAll(l.getTeamIDs());
                         lgs.add(new League(l));
                     }
                 }
                 leagues.add(Collections.unmodifiableList(lgs));
             }
         }
        if(. == .) {
            RiotAPI.getSummonersByID(new ArrayList<>(sumIDs));
            RiotAPI.getTeams(new ArrayList<>(teamIDs));
        }
        return Collections.unmodifiableList(leagues);
    }

    

Parameters:
summonerIDs the IDs of the summoners to get league entries for
Returns:
the summoners' league entries
    public static List<List<League>> getLeagueEntriesBySummonerID(final long... summonerIDs) {
        return getLeagueEntriesBySummonerID(Utils.convert(summonerIDs));
    }

    

Parameters:
summonerID the ID of the summoner to get league entries for
Returns:
the summoner's league entries
    public static List<LeaguegetLeagueEntriesBySummonerID(final long summonerID) {
        return getLeagueEntriesBySummonerID(new long[] {summonerID}).get(0);
    }

    

Parameters:
summonerNames the names of the summoners to get league entries for
Returns:
the summoners' league entries
    public static List<List<League>> getLeagueEntriesBySummonerName(final List<StringsummonerNames) {
        return getLeagueEntriesBySummoner(RiotAPI.getSummonersByName(summonerNames));
    }

    

Parameters:
summonerNames the names of the summoners to get league entries for
Returns:
the summoners' league entries
    public static List<List<League>> getLeagueEntriesBySummonerName(final String... summonerNames) {
        return getLeagueEntriesBySummoner(RiotAPI.getSummonersByName(summonerNames));
    }

    

Parameters:
summonerName the name of the summoner to get league entries for
Returns:
the summoner's league entries
    public static List<LeaguegetLeagueEntriesBySummonerName(final String summonerName) {
        return getLeagueEntriesBySummoner(RiotAPI.getSummonerByName(summonerName));
    }

    

Parameters:
teams the teams to get league entries for
Returns:
the teams' league entries
    public static List<List<League>> getLeagueEntriesByTeam(final List<Teamteams) {
        final List<StringIDs = new ArrayList<>();
        for(final Team team : teams) {
            IDs.add(team.getID());
        }
        return getLeagueEntriesByTeamID(IDs);
    }

    

Parameters:
teams the teams to get league entries for
Returns:
the teams' league entries
    public static List<List<League>> getLeagueEntriesByTeam(final Team... teams) {
        final List<StringIDs = new ArrayList<>();
        for(final Team team : teams) {
            IDs.add(team.getID());
        }
        return getLeagueEntriesByTeamID(IDs);
    }

    

Parameters:
team the team to get league entries for
Returns:
the team's league entries
    public static List<LeaguegetLeagueEntriesByTeam(final Team team) {
        return getLeagueEntriesByTeamID(team.getID());
    }

    

Parameters:
teamIDs the IDs of the teams to get league entries for
Returns:
the teams' league entries
    public static List<List<League>> getLeagueEntriesByTeamID(final List<StringteamIDs) {
        if(teamIDs.isEmpty()) {
            return Collections.emptyList();
        }
        final List<List<League>> leagues = new ArrayList<>();
        final Set<LongsummonerIDs = new HashSet<>();
        final Set<StringtmIDs = new HashSet<>();
        for(final List<Stringget : Utils.breakUpList(teamIDs, 10)) {
            final Map<StringList<com.robrua.orianna.type.dto.league.League>> leg = BaseRiotAPI.getTeamLeagueEntries(get);
            for(final String ID : get) {
                final List<Leaguelgs = new ArrayList<>();
                if(leg.get(ID) != null) {
                    for(final com.robrua.orianna.type.dto.league.League l : leg.get(ID)) {
                        summonerIDs.addAll(l.getSummonerIDs());
                        tmIDs.addAll(l.getTeamIDs());
                        lgs.add(new League(l));
                    }
                }
                leagues.add(Collections.unmodifiableList(lgs));
            }
        }
        if(. == .) {
            RiotAPI.getSummonersByID(new ArrayList<>(summonerIDs));
            RiotAPI.getTeams(new ArrayList<>(tmIDs));
        }
        return Collections.unmodifiableList(leagues);
    }

    

Parameters:
teamIDs the IDs of the teams to get league entries for
Returns:
the teams' league entries
    public static List<List<League>> getLeagueEntriesByTeamID(final String... teamIDs) {
        return getLeagueEntriesByTeamID(Arrays.asList(teamIDs));
    }

    

Parameters:
teamID the ID of the team to get league entries for
Returns:
the team's league entries
    public static List<LeaguegetLeagueEntriesByTeamID(final String teamID) {
        return getLeagueEntriesByTeamID(new String[] {teamID}).get(0);
    }

    

Parameters:
summoners the summoners to get leagues for
Returns:
the summoners' leagues
    public static List<List<League>> getLeaguesBySummoner(final List<Summonersummoners) {
        final List<LongIDs = new ArrayList<>();
        for(final Summoner summoner : summoners) {
            IDs.add(summoner.getID());
        }
        return getLeaguesBySummonerID(IDs);
    }

    

Parameters:
summoners the summoners to get leagues for
Returns:
the summoners' leagues
    public static List<List<League>> getLeaguesBySummoner(final Summoner... summoners) {
        final List<LongIDs = new ArrayList<>();
        for(final Summoner summoner : summoners) {
            IDs.add(summoner.getID());
        }
        return getLeaguesBySummonerID(IDs);
    }

    

Parameters:
summoner the summoner to get leagues for
Returns:
the summoner's leagues
    public static List<LeaguegetLeaguesBySummoner(final Summoner summoner) {
        return getLeaguesBySummonerID(summoner.getID());
    }

    

Parameters:
summonerIDs the IDs of the summoners to get leagues for
Returns:
the summoners' leagues
    public static List<List<League>> getLeaguesBySummonerID(final List<LongsummonerIDs) {
        if(summonerIDs.isEmpty()) {
            return Collections.emptyList();
        }
        final List<List<League>> leagues = new ArrayList<>();
        final Set<LongsumIDs = new HashSet<>();
        final Set<StringteamIDs = new HashSet<>();
        for(final List<Longget : Utils.breakUpList(summonerIDs, 10)) {
            final Map<LongList<com.robrua.orianna.type.dto.league.League>> leg = BaseRiotAPI.getSummonerLeagues(get);
            for(final Long ID : get) {
                final List<Leaguelgs = new ArrayList<>();
                if(leg.get(ID) != null) {
                    for(final com.robrua.orianna.type.dto.league.League l : leg.get(ID)) {
                        sumIDs.addAll(l.getSummonerIDs());
                        teamIDs.addAll(l.getTeamIDs());
                        lgs.add(new League(l));
                    }
                }
                leagues.add(Collections.unmodifiableList(lgs));
            }
        }
        if(. == .) {
            RiotAPI.getSummonersByID(new ArrayList<>(sumIDs));
            RiotAPI.getTeams(new ArrayList<>(teamIDs));
        }
        return Collections.unmodifiableList(leagues);
    }

    

Parameters:
summonerIDs the IDs of the summoners to get leagues for
Returns:
the summoners' leagues
    public static List<List<League>> getLeaguesBySummonerID(final long... summonerIDs) {
        return getLeaguesBySummonerID(Utils.convert(summonerIDs));
    }

    

Parameters:
summonerID the ID of the summoner to get leagues for
Returns:
the summoner's leagues
    public static List<LeaguegetLeaguesBySummonerID(final long summonerID) {
        return getLeaguesBySummonerID(new long[] {summonerID}).get(0);
    }

    

Parameters:
summonerNames the names of the summoners to get leagues for
Returns:
the summoners' leagues
    public static List<List<League>> getLeaguesBySummonerName(final List<StringsummonerNames) {
        return getLeaguesBySummoner(RiotAPI.getSummonersByName(summonerNames));
    }

    

Parameters:
summonerNames the names of the summoners to get leagues for
Returns:
the summoners' leagues
    public static List<List<League>> getLeaguesBySummonerName(final String... summonerNames) {
        return getLeaguesBySummoner(RiotAPI.getSummonersByName(summonerNames));
    }

    

Parameters:
summonerName the name of the summoner to get leagues for
Returns:
the summoner's leagues
    public static List<LeaguegetLeaguesBySummonerName(final String summonerName) {
        return getLeaguesBySummoner(RiotAPI.getSummonerByName(summonerName));
    }

    

Parameters:
teams the teams to get leagues for
Returns:
the teams' leagues
    public static List<List<League>> getLeaguesByTeam(final List<Teamteams) {
        final List<StringIDs = new ArrayList<>();
        for(final Team team : teams) {
            IDs.add(team.getID());
        }
        return getLeaguesByTeamID(IDs);
    }

    

Parameters:
teams the teams to get leagues for
Returns:
the teams' leagues
    public static List<List<League>> getLeaguesByTeam(final Team... teams) {
        final List<StringIDs = new ArrayList<>();
        for(final Team team : teams) {
            IDs.add(team.getID());
        }
        return getLeaguesByTeamID(IDs);
    }

    

Parameters:
team the team to get leagues for
Returns:
the team's leagues
    public static List<LeaguegetLeaguesByTeam(final Team team) {
        return getLeaguesByTeamID(team.getID());
    }

    

Parameters:
teamIDs the IDs of the teams to get leagues for
Returns:
the teams' leagues
    public static List<List<League>> getLeaguesByTeamID(final List<StringteamIDs) {
        if(teamIDs.isEmpty()) {
            return Collections.emptyList();
        }
        final List<List<League>> leagues = new ArrayList<>();
        final Set<LongsummonerIDs = new HashSet<>();
        final Set<StringtmIDs = new HashSet<>();
        for(final List<Stringget : Utils.breakUpList(teamIDs, 10)) {
            final Map<StringList<com.robrua.orianna.type.dto.league.League>> leg = BaseRiotAPI.getTeamLeagues(get);
            for(final String ID : get) {
                final List<Leaguelgs = new ArrayList<>();
                if(leg.get(ID) != null) {
                    for(final com.robrua.orianna.type.dto.league.League l : leg.get(ID)) {
                        summonerIDs.addAll(l.getSummonerIDs());
                        tmIDs.addAll(l.getTeamIDs());
                        lgs.add(new League(l));
                    }
                }
                leagues.add(Collections.unmodifiableList(lgs));
            }
        }
        if(. == .) {
            RiotAPI.getSummonersByID(new ArrayList<>(summonerIDs));
            RiotAPI.getTeams(new ArrayList<>(tmIDs));
        }
        return Collections.unmodifiableList(leagues);
    }

    

Parameters:
teamIDs the IDs of the teams to get leagues for
Returns:
the teams' leagues
    public static List<List<League>> getLeaguesByTeamID(final String... teamIDs) {
        return getLeaguesByTeamID(Arrays.asList(teamIDs));
    }

    

Parameters:
teamID the ID of the team to get leagues for
Returns:
the team's leagues
    public static List<LeaguegetLeaguesByTeamID(final String teamID) {
        return getLeaguesByTeamID(new String[] {teamID}).get(0);
    }

    

Parameters:
queueType the ranked queue type to get the master league of
Returns:
the master league
    public static League getMaster(final QueueType queueType) {
        final com.robrua.orianna.type.dto.league.League league = BaseRiotAPI.getMaster(queueType);
        if(. == .) {
            RiotAPI.getSummonersByID(new ArrayList<>(league.getSummonerIDs()));
            RiotAPI.getTeams(new ArrayList<>(league.getTeamIDs()));
        }
        return new League(league);
    }
New to GrepCode? Check out our FAQ X