Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.robrua.orianna.type.core.league;
  
  import java.util.List;
  
 
 public class League extends OriannaObject<com.robrua.orianna.type.dto.league.League> {
     private static final long serialVersionUID = -5641296195275085013L;
     private List<LeagueEntryentries;
     private Summoner summoner;
     private Team team;

    

Parameters:
data the underlying dto
 
     public League(final com.robrua.orianna.type.dto.league.League data) {
         super(datacom.robrua.orianna.type.dto.league.League.class);
     }

    
The requested league entries sorted by LP

Returns:
the requested league entries sorted by LP
 
     public List<LeagueEntrygetEntries() {
         if( == null) {
              = new ArrayList<>();
             for(final com.robrua.orianna.type.dto.league.LeagueEntry entry : .getEntries()) {
                 .add(new LeagueEntry(entry));
             }
             Collections.sort(new Comparator<LeagueEntry>() {
                 @Override
                 public int compare(final LeagueEntry o1final LeagueEntry o2) {
                     return Integer.compare(o2.getLeaguePoints(), o1.getLeaguePoints());
                 }
             });
         }
 
         return Collections.unmodifiableList();
     }

    
This name is an internal place-holder name only. Display and localization of names in the game client are handled client-side.

Returns:
the internal place-holder name
 
     public String getName() {
         return super.getString(.getName());
     }

    
Gets the entry for the relevant participant that is a member of this league (i.e., a requested summoner ID, a requested team ID, or the ID of a team to which one of the requested summoners belongs). Only present when full league is requested so that participant's entry can be identified. Not present when individual entry is requested.

Returns:
the relevant participant entry
 
     public LeagueEntry getParticipantEntry() {
         for(final LeagueEntry e : getEntries()) {
             if(e.getID().equals(getParticipantID())) {
                 return e;
             }
         }
 
         return null;
     }

    
Specifies the relevant participant that is a member of this league (i.e., a requested summoner ID, a requested team ID, or the ID of a team to which one of the requested summoners belongs). Only present when full league is requested so that participant's entry can be identified. Not present when individual entry is requested.

Returns:
the relevant participant ID
 
     public String getParticipantID() {
         return super.getString(.getParticipantId());
     }

    
Gets the participant summoner (if participantID is a summoner ID)

Returns:
the participant summoner, or null if participantID was a team ID
 
     public Summoner getParticipantSummoner() {
        if( != null) {
            return ;
        }
        final String s = .getParticipantId();
        if(s == null) {
            throw new MissingDataException("Participant ID is null.");
        }
        try {
            final long summonerID = Long.parseLong(s);
             = RiotAPI.getSummonerByID(summonerID);
            return ;
        }
        catch(final NumberFormatException e) {
            return null;
        }
    }

    
Gets the participant team (if participantID is a team ID)

Returns:
the participant team, or null if participantID was a summoner ID
    public Team getParticipantTeam() {
        if( != null) {
            return ;
        }
        final String s = .getParticipantId();
        if(s == null) {
            throw new MissingDataException("Participant ID is null.");
        }
        try {
            Long.parseLong(s);
            // If the string fits into a long it's a summoner ID, not a team ID
            return null;
        }
        catch(final NumberFormatException e) {
             = RiotAPI.getTeam(s);
            return ;
        }
    }

    
The league's queue type

Returns:
the league's queue type
    public QueueType getQueueType() {
        return QueueType.valueOf(super.getString(.getQueue()));
    }

    
The league's tier

Returns:
the league's tier
    public Tier getTier() {
        return Tier.valueOf(super.getString(.getTier()));
    }
    /*
     * (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return "League (" + getName() + ")";
    }
New to GrepCode? Check out our FAQ X