Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.robrua.orianna.type.core.match;
  
  import java.util.List;
  
 
 public class Participant extends OriannaObject<CombinedParticipant> {
     private static final long serialVersionUID = -1560511644551713929L;
     private Champion champion;
     private List<ParticipantMasterymasteries;
     private List<ParticipantRunerunes;
     private SummonerSpell spell1spell2;
     private ParticipantStats stats;
     private Summoner summoner;
     private ParticipantTimeline timeline;

    

Parameters:
participantData the underlying participant dto
identityData the underlying identity dto
 
     public Participant(final com.robrua.orianna.type.dto.match.Participant participantData,
             final com.robrua.orianna.type.dto.match.ParticipantIdentity identityData) {
         super(new CombinedParticipant(participantDataidentityData), com.robrua.orianna.type.dto.match.CombinedParticipant.class);
     }

    
The participant's champion

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

    
Champion ID

Returns:
champion ID
 
     public long getChampionID() {
         return super.getInteger(.getParticipant().getChampionId());
     }

    
List of mastery information

Returns:
list of mastery information
 
     public List<ParticipantMasterygetMasteries() {
         if( == null) {
              = new ArrayList<>();
             for(final com.robrua.orianna.type.dto.match.Mastery mastery : .getParticipant().getMasteries()) {
                 .add(new ParticipantMastery(mastery));
             }
         }
 
         return Collections.unmodifiableList();
     }

    
Match history URI for this participant

Returns:
match history URI for this participant
 
     public String getMatchHistoryURI() {
         return super.getString(.getIdentity().getPlayer().getMatchHistoryUri());
     }

    
The ID of this participant for timeline reference

Returns:
the ID of this participant for timeline reference
 
     public int getParticipantID() {
         return super.getInteger(.getParticipant().getParticipantId());
    }

    
Highest ranked tier achieved for the previous season. Used to display border in game loading screen.

Returns:
highest ranked tier achieved for the previous season. Used to display border in game loading screen.
    public Tier getPreviousSeasonTier() {
        try {
            return Tier.valueOf(super.getString(.getParticipant().getHighestAchievedSeasonTier()));
        }
        catch(final IllegalArgumentException e) {
            return .;
        }
    }

    
Profile icon ID

Returns:
profile icon ID
    public int getProfileIconID() {
        return super.getInteger(.getIdentity().getPlayer().getProfileIcon());
    }

    
List of rune information

Returns:
list of rune information
    public List<ParticipantRunegetRunes() {
        if( == null) {
             = new ArrayList<>();
            for(final com.robrua.orianna.type.dto.match.Rune rune : .getParticipant().getRunes()) {
                .add(new ParticipantRune(rune));
            }
        }
        return Collections.unmodifiableList();
    }

    
Participant stats

Returns:
participant stats
    public ParticipantStats getStats() {
        if( == null) {
             = new ParticipantStats(.getParticipant().getStats());
        }
        return ;
    }

    
The summoner this participant represents

Returns:
the summoner this participant represents
    public Summoner getSummoner() {
        if( != null) {
            return ;
        }
        final ParticipantIdentity identity = .getIdentity();
        if(identity == null) {
            return null;
        }
        final Player player = identity.getPlayer();
        if(player == null) {
            return null;
        }
        final Long l = player.getSummonerId();
        if(l == null) {
            throw new MissingDataException("Summoner ID is null.");
        }
         = RiotAPI.getSummonerByID(l.longValue());
        return ;
    }

    
The ID of the summoner this participant represents

Returns:
the ID of the summoner this participant represents
    public long getSummonerID() {
        return super.getLong(.getIdentity().getPlayer().getSummonerId());
    }

    
The name of the summoner this participant represents

Returns:
the name of the summoner this participant represents
    public String getSummonerName() {
        return super.getString(.getIdentity().getPlayer().getSummonerName());
    }

    
First summoner spell

Returns:
first summoner spell
    public SummonerSpell getSummonerSpell1() {
        if( != null) {
            return ;
        }
        final Integer i = .getParticipant().getSpell1Id();
        if(i == null) {
            throw new MissingDataException("Summoner Spell #1 ID is null.");
        }
         = RiotAPI.getSummonerSpell(i.longValue());
        return ;
    }

    
First summoner spell ID

Returns:
first summoner spell ID
    public long getSummonerSpell1ID() {
        return super.getInteger(.getParticipant().getSpell1Id());
    }

    
Second summoner spell

Returns:
second summoner spell
    public SummonerSpell getSummonerSpell2() {
        if( != null) {
            return ;
        }
        final Integer i = .getParticipant().getSpell2Id();
        if(i == null) {
            throw new MissingDataException("Summoner Spell #2 ID is null.");
        }
         = RiotAPI.getSummonerSpell(i.longValue());
        return ;
    }

    
Second summoner spell ID

Returns:
second summoner spell ID
    public long getSummonerSpell2ID() {
        return super.getInteger(.getParticipant().getSpell2Id());
    }

    
The participant's team

Returns:
the participant's team
    public Side getTeam() {
        return Side.forID(super.getInteger(.getParticipant().getTeamId()));
    }

    
Timeline data. Delta fields refer to values for the specified period (e.g., the gold per minute over the first 10 minutes of the game versus the second 20 minutes of the game. Diffs fields refer to the deltas versus the calculated lane opponent(s).

Returns:
timeline data
    public ParticipantTimeline getTimeline() {
        if( == null) {
             = new ParticipantTimeline(.getParticipant().getTimeline());
        }
        return ;
    }
    /*
     * (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        if(getSummonerName() != null) {
            return "Participant (" + getSummonerName() + " on " + getChampion() + ")";
        }
        return "Participant (" + getChampion() + ")";
    }
New to GrepCode? Check out our FAQ X