Start line:  
End line:  

Snippet Preview

Snippet HTML Code

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

Parameters:
ID the ID of the match to get
Returns:
the match
    public synchronized static Match getMatch(final long ID) {
        Match match = ..get(Match.classID);
        if(match != null) {
            return match;
        }
        final MatchDetail mtch = BaseRiotAPI.getMatch(ID);
        match = new Match(mtch);
        if(. == .) {
            RiotAPI.getItems(new ArrayList<>(mtch.getItemIDs()));
            RiotAPI.getChampionsByID(new ArrayList<>(mtch.getChampionIDs()));
            RiotAPI.getMasteries(new ArrayList<>(mtch.getMasteryIDs()));
            RiotAPI.getRunes(new ArrayList<>(mtch.getRuneIDs()));
            RiotAPI.getSummonersByID(new ArrayList<>(mtch.getSummonerIDs()));
            RiotAPI.getSummonerSpells(new ArrayList<>(mtch.getSummonerSpellIDs()));
        }
        ..store(matchID);
        return match;
    }

    

Parameters:
IDs the IDs of the matches to get
Returns:
the matches
    public synchronized static List<MatchgetMatches(final List<LongIDs) {
        if(IDs.isEmpty()) {
            return Collections.emptyList();
        }
        Set<LongitemIDs = nullchampionIDs = nullmasteryIDs = nullruneIDs = nullsummonerIDs = nullsummonerSpellIDs = null;
        if(. == .) {
            itemIDs = new HashSet<>();
            championIDs = new HashSet<>();
            masteryIDs = new HashSet<>();
            runeIDs = new HashSet<>();
            summonerIDs = new HashSet<>();
            summonerSpellIDs = new HashSet<>();
        }
        final List<Matchmatches = ..get(Match.classIDs);
        final List<MatchnewMatches = new ArrayList<>();
        final List<LongnewIDs = new ArrayList<>();
        for(int i = 0; i < matches.size(); i++) {
            if(matches.get(i) == null) {
                final MatchDetail mtch = BaseRiotAPI.getMatch(IDs.get(i));
                if(. == .) {
                    itemIDs.addAll(mtch.getItemIDs());
                    championIDs.addAll(mtch.getChampionIDs());
                    masteryIDs.addAll(mtch.getMasteryIDs());
                    runeIDs.addAll(mtch.getRuneIDs());
                    summonerIDs.addAll(mtch.getSummonerIDs());
                    summonerSpellIDs.addAll(mtch.getSummonerSpellIDs());
                }
                final Match match = new Match(mtch);
                newMatches.add(match);
                newIDs.add(IDs.get(i));
                matches.set(imatch);
            }
        }
        if(. == .) {
            RiotAPI.getItems(new ArrayList<>(itemIDs));
            RiotAPI.getChampionsByID(new ArrayList<>(championIDs));
            RiotAPI.getMasteries(new ArrayList<>(masteryIDs));
            RiotAPI.getRunes(new ArrayList<>(runeIDs));
            RiotAPI.getSummonersByID(new ArrayList<>(summonerIDs));
            RiotAPI.getSummonerSpells(new ArrayList<>(summonerSpellIDs));
        }
        ..store(newMatchesnewIDsfalse);
        return matches;
    }
New to GrepCode? Check out our FAQ X