Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.robrua.orianna.type.core.game;
 
 
public class Player extends OriannaObject<com.robrua.orianna.type.dto.game.Player> {
    private static final long serialVersionUID = -1548477059435968471L;
    private Champion champion;
    private Summoner summoner;

    

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

    
Champion associated with the player

Returns:
champion associated with the player
    public Champion getChampion() {
        if( != null) {
            return ;
        }
        final Integer i = .getChampionId();
        if(i == null) {
            throw new MissingDataException("Champion ID is null.");
        }
         = RiotAPI.getChampionByID(i.longValue());
        return ;
    }

    
Champion id associated with player

Returns:
champion id associated with player
    public long getChampionID() {
        return super.getInteger(.getChampionId());
    }

    
Summoner associated with the player

Returns:
summoner associated with the player
    public Summoner getSummoner() {
        if( != null) {
            return ;
        }
        final Long l = .getSummonerId();
        if(l == null) {
            throw new MissingDataException("Summoner ID is null.");
        }
         = RiotAPI.getSummonerByID(l.longValue());
        return ;
    }

    
Summoner id associated with player

Returns:
summoner id associated with player
    public long getSummonerID() {
        return super.getLong(.getSummonerId());
    }

    
Team associated with the player

Returns:
team associated with the player
    public Side getTeam() {
        return Side.forID(super.getInteger(.getTeamId()));
    }
    /*
     * (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return "Player (" + getSummoner() + " on " + getChampion() + ")";
    }
New to GrepCode? Check out our FAQ X