Skip to content

Commit

Permalink
API complete
Browse files Browse the repository at this point in the history
  • Loading branch information
aaryn101 committed Dec 14, 2013
1 parent f45971b commit 719f15b
Show file tree
Hide file tree
Showing 34 changed files with 974 additions and 76 deletions.
3 changes: 2 additions & 1 deletion src/main/java/lol4j/client/Lol4JClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
/**
* Created by Aaryn101 on 12/10/13.
*/
public interface Lol4JClient extends GameResource, ChampionResource, LeagueResource, StatsResource, SummonerResource {
public interface Lol4JClient extends GameResource, ChampionResource, LeagueResource, StatsResource, SummonerResource,
TeamResource {
}
32 changes: 32 additions & 0 deletions src/main/java/lol4j/client/impl/Lol4JClientImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@
import lol4j.protocol.dto.stats.PlayerStatsSummaryListDto;
import lol4j.protocol.dto.stats.RankedStatsDto;
import lol4j.protocol.dto.summoner.MasteryPagesDto;
import lol4j.protocol.dto.summoner.RunePagesDto;
import lol4j.protocol.dto.summoner.SummonerDto;
import lol4j.protocol.dto.summoner.SummonerNameListDto;
import lol4j.protocol.dto.team.TeamDto;
import lol4j.protocol.resource.*;
import lol4j.protocol.resource.impl.ResourceFactory;
import lol4j.util.Region;
import lol4j.util.Season;

import java.util.List;
import java.util.Map;

/**
Expand All @@ -23,6 +28,7 @@ public class Lol4JClientImpl implements Lol4JClient {
private LeagueResource leagueResource;
private StatsResource statsResource;
private SummonerResource summonerResource;
private TeamResource teamResource;

public Lol4JClientImpl(String apiKey) {
ResourceFactory resourceFactory = new ResourceFactory(apiKey);
Expand All @@ -32,6 +38,7 @@ public Lol4JClientImpl(String apiKey) {
leagueResource = resourceFactory.createLeagueResource();
statsResource = resourceFactory.createStatsResource();
summonerResource = resourceFactory.createSummonerResource();
teamResource = resourceFactory.createTeamResource();
}

@Override
Expand Down Expand Up @@ -63,4 +70,29 @@ public RankedStatsDto getRankedStats(Region region, long summonerId, Season seas
public MasteryPagesDto getMasteryPages(Region region, long summonerId) {
return summonerResource.getMasteryPages(region, summonerId);
}

@Override
public RunePagesDto getRunePages(Region region, long summonerId) {
return summonerResource.getRunePages(region, summonerId);
}

@Override
public SummonerDto getSummoner(Region region, String name) {
return summonerResource.getSummoner(region, name);
}

@Override
public SummonerDto getSummoner(Region region, long summonerId) {
return summonerResource.getSummoner(region, summonerId);
}

@Override
public SummonerNameListDto getSummonerNames(Region region, List<Long> summonerIds) {
return summonerResource.getSummonerNames(region, summonerIds);
}

@Override
public List<TeamDto> getTeams(Region region, long summonerId) {
return teamResource.getTeams(region, summonerId);
}
}
2 changes: 2 additions & 0 deletions src/main/java/lol4j/protocol/dto/stats/AggregatedStatDto.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package lol4j.protocol.dto.stats;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Created by Aaryn101 on 12/11/13.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class AggregatedStatDto {
@JsonProperty("c")
private int count;
private int id;
private String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public List<MasteryPageDto> getPages() {
}

public long getSummonerId() {

return summonerId;
}

Expand Down
46 changes: 46 additions & 0 deletions src/main/java/lol4j/protocol/dto/summoner/RuneDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package lol4j.protocol.dto.summoner;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Created by Aaryn101 on 12/12/13.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class RuneDto {
private String description;
private int id;
private String name;
private int tier;

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public int getTier() {
return tier;
}

public void setTier(int tier) {
this.tier = tier;
}
}
46 changes: 46 additions & 0 deletions src/main/java/lol4j/protocol/dto/summoner/RunePageDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package lol4j.protocol.dto.summoner;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.util.ArrayList;
import java.util.List;

/**
* Created by Aaryn101 on 12/12/13.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class RunePageDto {
private boolean current;
private long id;
private String name;
private List<RuneSlotDto> slots = new ArrayList<>();

public List<RuneSlotDto> getSlots() {
return slots;
}

public boolean isCurrent() {

return current;
}

public void setCurrent(boolean current) {
this.current = current;
}

public long getId() {
return id;
}

public void setId(long id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}
}
28 changes: 28 additions & 0 deletions src/main/java/lol4j/protocol/dto/summoner/RunePagesDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package lol4j.protocol.dto.summoner;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.util.HashSet;
import java.util.Set;

/**
* Created by Aaryn101 on 12/12/13.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class RunePagesDto {
private Set<RunePageDto> pages = new HashSet<>();
private long summonerId;

public long getSummonerId() {
return summonerId;
}

public void setSummonerId(long summonerId) {
this.summonerId = summonerId;
}

public Set<RunePageDto> getPages() {

return pages;
}
}
28 changes: 28 additions & 0 deletions src/main/java/lol4j/protocol/dto/summoner/RuneSlotDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package lol4j.protocol.dto.summoner;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Created by Aaryn101 on 12/12/13.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class RuneSlotDto {
private RuneDto rune;
private int runeSlotId;

public RuneDto getRune() {
return rune;
}

public void setRune(RuneDto rune) {
this.rune = rune;
}

public int getRuneSlotId() {
return runeSlotId;
}

public void setRuneSlotId(int runeSlotId) {
this.runeSlotId = runeSlotId;
}
}
66 changes: 66 additions & 0 deletions src/main/java/lol4j/protocol/dto/summoner/SummonerDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package lol4j.protocol.dto.summoner;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.util.Date;

/**
* Created by Aaryn101 on 12/13/13.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class SummonerDto {
private long id;
private String name;
private int profileIconId;
private long revisionDate;
private Date revisionDateStr;
private long summonerLevel;

public long getId() {
return id;
}

public void setId(long id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public int getProfileIconId() {
return profileIconId;
}

public void setProfileIconId(int profileIconId) {
this.profileIconId = profileIconId;
}

public long getRevisionDate() {
return revisionDate;
}

public void setRevisionDate(long revisionDate) {
this.revisionDate = revisionDate;
}

public Date getRevisionDateStr() {
return revisionDateStr;
}

public void setRevisionDateStr(Date revisionDateStr) {
this.revisionDateStr = revisionDateStr;
}

public long getSummonerLevel() {
return summonerLevel;
}

public void setSummonerLevel(long summonerLevel) {
this.summonerLevel = summonerLevel;
}
}
28 changes: 28 additions & 0 deletions src/main/java/lol4j/protocol/dto/summoner/SummonerNameDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package lol4j.protocol.dto.summoner;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* Created by Aaryn101 on 12/13/13.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class SummonerNameDto {
private long id;
private String name;

public long getId() {
return id;
}

public void setId(long id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}
}
18 changes: 18 additions & 0 deletions src/main/java/lol4j/protocol/dto/summoner/SummonerNameListDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package lol4j.protocol.dto.summoner;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.util.ArrayList;
import java.util.List;

/**
* Created by Aaryn101 on 12/13/13.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class SummonerNameListDto {
private List<SummonerNameDto> summoners = new ArrayList<>();

public List<SummonerNameDto> getSummoners() {
return summoners;
}
}
Loading

0 comments on commit 719f15b

Please sign in to comment.