Start line:  
End line:  

Snippet Preview

Snippet HTML Code

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

Parameters:
champion the champion to get status for
Returns:
the champion's status
 
     public static ChampionStatus getChampionStatus(final Champion champion) {
         return getChampionStatus(champion.getID());
     }

    

Parameters:
ID the ID of the champion to get status for
Returns:
the champion's status
 
     public static ChampionStatus getChampionStatus(final long ID) {
         final com.robrua.orianna.type.dto.champion.Champion status = BaseRiotAPI.getChampionStatus(ID);
         RiotAPI.getChampionsByID(status.getId().longValue());
 
         return new ChampionStatus(status);
     }

    

Returns:
all champion's statuses
 
     public static Map<ChampionChampionStatusgetChampionStatuses() {
         return getChampionStatuses(false);
     }

    

Parameters:
freeToPlay whether to only get free to play champions
Returns:
all (possibly only free to play) champion's statuses
 
     public static Map<ChampionChampionStatusgetChampionStatuses(final boolean freeToPlay) {
         final ChampionList st = BaseRiotAPI.getChampionStatuses(freeToPlay);
 
         final List<Longindex = new ArrayList<>(st.getChampionIDs());
         final List<Championchampions = RiotAPI.getChampionsByID(index);
 
         final Map<ChampionChampionStatusstatuses = new HashMap<>();
         for(final com.robrua.orianna.type.dto.champion.Champion ch : st.getChampions()) {
             statuses.put(champions.get(index.indexOf(ch.getId().longValue())), new ChampionStatus(ch));
         }
 
         return Collections.unmodifiableMap(statuses);
     }

    

Parameters:
IDs the IDs of the champions to get statuses for
Returns:
the champions' statuses
 
     public static List<ChampionStatusgetChampionStatuses(final List<LongIDs) {
         if(IDs.isEmpty()) {
             return Collections.emptyList();
         }
 
         final ChampionList st = BaseRiotAPI.getChampionStatuses(false);
 
         final Set<Longset = new HashSet<>(IDs);
         for(int i = 0; i < st.getChampions().size(); i++) {
             if(!set.contains(st.getChampions().get(i).getId())) {
                 st.getChampions().remove(i);
                 i--;
             }
         }
 
         final List<ChampionStatusstatuses = new ArrayList<>(st.getChampions().size());
         for(final com.robrua.orianna.type.dto.champion.Champion ch : st.getChampions()) {
             statuses.add(new ChampionStatus(ch));
         }
         RiotAPI.getChampionsByID(new ArrayList<>(st.getChampionIDs()));
 
         return Collections.unmodifiableList(statuses);
     }

    

Parameters:
IDs the IDs of the champions to get statuses for
Returns:
the champions' statuses
 
     public static List<ChampionStatusgetChampionStatuses(final long... IDs) {
        return getChampionStatuses(Utils.convert(IDs));
    }
New to GrepCode? Check out our FAQ X