Skip to content

Commit

Permalink
Updated to support latest APIs/supported regions. Fixed two broken te…
Browse files Browse the repository at this point in the history
…sts and finished the Static Data APIs.
  • Loading branch information
aaryn101 committed Apr 5, 2014
1 parent 779eeda commit 90c4088
Show file tree
Hide file tree
Showing 24 changed files with 825 additions and 81 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ Example Usage
Lol4JClient client = new Lol4JClientImpl("apiKey");

ChampionListDto championList = client.getAllChampions(Region.NA, true);
RecentGamesDto recentGames = client.getRecentGames(Region.NA, 19163557);
Map<String, LeagueDto> leaguesData = client.getLeaguesData(Region.NA, 19163557);
PlayerStatsSummaryListDto playerStatsSummaries = client.getPlayerStatsSummaries(Region.NA, 19163557, Season.SEASON_3);
RankedStatsDto rankedStats = client.getRankedStats(Region.NA, 19163557, Season.SEASON_3);
MasteryPagesDto masteryPages = client.getMasteryPages(Region.NA, 19163557);
RecentGamesDto recentGames = client.getRecentGames(19163557, Region.NA);
Map<String, LeagueDto> leaguesData = client.getLeaguesData(19163557, Region.NA);
PlayerStatsSummaryListDto playerStatsSummaries = client.getPlayerStatsSummaries(19163557, Region.NA, Season.SEASON_3);
RankedStatsDto rankedStats = client.getRankedStats(19163557, Region.NA, Season.SEASON_3);
MasteryPagesDto masteryPages = client.getMasteryPages(19163557, Region.NA);
```

Rate Limiting
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'java'
apply plugin: 'jacoco'

sourceCompatibility = 1.7
version = '1.3.1'
version = '2.0'

repositories {
mavenCentral()
Expand Down
44 changes: 32 additions & 12 deletions src/main/java/lol4j/client/impl/Lol4JClientImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
import lol4j.protocol.dto.game.RecentGamesDto;
import lol4j.protocol.dto.league.LeagueDto;
import lol4j.protocol.dto.league.LeagueItemDto;
import lol4j.protocol.dto.lolstaticdata.ChampionDto;
import lol4j.protocol.dto.lolstaticdata.ItemDto;
import lol4j.protocol.dto.lolstaticdata.MasteryDto;
import lol4j.protocol.dto.lolstaticdata.MasteryListDto;
import lol4j.protocol.dto.lolstaticdata.*;
import lol4j.protocol.dto.stats.PlayerStatsSummaryListDto;
import lol4j.protocol.dto.stats.RankedStatsDto;
import lol4j.protocol.dto.summoner.MasteryPagesDto;
Expand All @@ -20,9 +17,7 @@
import lol4j.service.impl.ApiRequestManager;
import lol4j.util.Region;
import lol4j.util.game.SubType;
import lol4j.util.lolstaticdata.ChampData;
import lol4j.util.lolstaticdata.ItemData;
import lol4j.util.lolstaticdata.MasteryData;
import lol4j.util.lolstaticdata.*;
import lol4j.util.stats.Season;

import java.util.List;
Expand Down Expand Up @@ -171,13 +166,13 @@ public ChampionDto getChampion(String id, Region region, String locale, String v
}

@Override
public ItemDto getItem(String id, Region region, String locale, String version, List<ItemData> requestedData) {
public BasicDataDto getItem(String id, Region region, String locale, String version, List<ItemData> requestedData) {
return lolStaticDataResource.getItem(id, region, locale, version, requestedData);
}

@Override
public ItemListDto getItems(Region region, String locale, String version, List<ItemData> requestedData) {
return lolStaticDataResource.getItems(region, locale, version, requestedData);
public ItemListDto getItemList(Region region, String locale, String version, List<ItemData> requestedData) {
return lolStaticDataResource.getItemList(region, locale, version, requestedData);
}

@Override
Expand All @@ -186,8 +181,33 @@ public MasteryDto getMastery(String id, Region region, String locale, String ver
}

@Override
public MasteryListDto getMasteries(Region region, String locale, String version, List<MasteryData> requestedData) {
return lolStaticDataResource.getMasteries(region, locale, version, requestedData);
public MasteryListDto getMasteryList(Region region, String locale, String version, List<MasteryData> requestedData) {
return lolStaticDataResource.getMasteryList(region, locale, version, requestedData);
}

@Override
public RealmDto getRealm(Region region) {
return lolStaticDataResource.getRealm(region);
}

@Override
public RuneListDto getRuneList(Region region, String locale, String version, List<RuneData> requestedData) {
return lolStaticDataResource.getRuneList(region, locale, version, requestedData);
}

@Override
public BasicDataDto getRune(String id, Region region, String locale, String version, List<RuneData> requestedData) {
return lolStaticDataResource.getRune(id, region, locale, version, requestedData);
}

@Override
public SummonerSpellListDto getSummonerSpellList(Region region, String locale, String version, List<SummonerSpellData> requestedData) {
return lolStaticDataResource.getSummonerSpellList(region, locale, version, requestedData);
}

@Override
public SummonerSpellDto getSummonerSpell(String id, Region region, String locale, String version, List<SummonerSpellData> requestedData) {
return lolStaticDataResource.getSummonerSpell(id, region, locale, version, requestedData);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Created by Aaron Corley on 3/10/14.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class ItemDto {
public class BasicDataDto {
private String colloq;
private boolean consumeOnFull;
private boolean consumed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ public class ChampionSpellDto {
private String costBurn;
private String costType;
private String description;
private List<Object> effect = new ArrayList<>();
private List<List<Integer>> effect = new ArrayList<>();
private List<String> effectBurn = new ArrayList<>();
private String id;
private ImageDto image;
@JsonProperty(value = "leveltip")
private LevelTipDto levelTip;
Expand All @@ -40,7 +39,7 @@ public List<Integer> getCost() {
return cost;
}

public List<Object> getEffect() {
public List<List<Integer>> getEffect() {
return effect;
}

Expand Down Expand Up @@ -84,14 +83,6 @@ public void setDescription(String description) {
this.description = description;
}

public String getId() {
return id;
}

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

public ImageDto getImage() {
return image;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lol4j.protocol.resource;
package lol4j.protocol.dto.lolstaticdata;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package lol4j.protocol.resource;
package lol4j.protocol.dto.lolstaticdata;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lol4j.protocol.dto.lolstaticdata.ItemDto;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -12,14 +11,14 @@
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class ItemListDto {
private ItemDto basic;
private Map<String, ItemDto> data;
private BasicDataDto basic;
private Map<String, BasicDataDto> data;
private List<GroupDto> groups = new ArrayList<>();
private List<ItemTreeDto> tree = new ArrayList<>();
private String type;
private String version;

public Map<String, ItemDto> getData() {
public Map<String, BasicDataDto> getData() {
return data;
}

Expand All @@ -31,12 +30,12 @@ public List<ItemTreeDto> getTree() {
return tree;
}

public ItemDto getBasic() {
public BasicDataDto getBasic() {

return basic;
}

public void setBasic(ItemDto basic) {
public void setBasic(BasicDataDto basic) {
this.basic = basic;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lol4j.protocol.resource;
package lol4j.protocol.dto.lolstaticdata;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

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

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

import java.util.HashMap;
import java.util.Map;

/**
* Created by Aaron Corley on 3/17/14.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class RealmDto {
@JsonProperty("cdn")
private String cdnBaseUrl;
@JsonProperty("css")
private String cssVersion;
@JsonProperty("dd")
private String dragonMagicVersion;
@JsonProperty("l")
private String defaultLanguage;
@JsonProperty("lg")
private String legacyScriptMode;
@JsonProperty("n")
private Map<String, String> dataTypeVersionMap = new HashMap<>();
@JsonProperty("profileiconmax")
private int profileIconMax;
private String store;
@JsonProperty("v")
private String version;

public Map<String, String> getDataTypeVersionMap() {
return dataTypeVersionMap;
}

public String getCdnBaseUrl() {

return cdnBaseUrl;
}

public void setCdnBaseUrl(String cdnBaseUrl) {
this.cdnBaseUrl = cdnBaseUrl;
}

public String getCssVersion() {
return cssVersion;
}

public void setCssVersion(String cssVersion) {
this.cssVersion = cssVersion;
}

public String getDragonMagicVersion() {
return dragonMagicVersion;
}

public void setDragonMagicVersion(String dragonMagicVersion) {
this.dragonMagicVersion = dragonMagicVersion;
}

public String getDefaultLanguage() {
return defaultLanguage;
}

public void setDefaultLanguage(String defaultLanguage) {
this.defaultLanguage = defaultLanguage;
}

public String getLegacyScriptMode() {
return legacyScriptMode;
}

public void setLegacyScriptMode(String legacyScriptMode) {
this.legacyScriptMode = legacyScriptMode;
}

public int getProfileIconMax() {
return profileIconMax;
}

public void setProfileIconMax(int profileIconMax) {
this.profileIconMax = profileIconMax;
}

public String getStore() {
return store;
}

public void setStore(String store) {
this.store = store;
}

public String getVersion() {
return version;
}

public void setVersion(String version) {
this.version = version;
}
}
45 changes: 45 additions & 0 deletions src/main/java/lol4j/protocol/dto/lolstaticdata/RuneListDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package lol4j.protocol.dto.lolstaticdata;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.util.HashMap;
import java.util.Map;

/**
* Created by Aaron Corley on 3/18/14.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class RuneListDto {
private BasicDataDto basic;
private Map<String, BasicDataDto> data = new HashMap<>();
private String type;
private String version;

public BasicDataDto getBasic() {
return basic;
}

public void setBasic(BasicDataDto basic) {
this.basic = basic;
}

public Map<String, BasicDataDto> getData() {
return data;
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public String getVersion() {
return version;
}

public void setVersion(String version) {
this.version = version;
}
}
11 changes: 5 additions & 6 deletions src/main/java/lol4j/protocol/dto/lolstaticdata/SpellVarsDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,23 @@

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

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

/**
* Created by Aaron Corley on 3/9/14.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class SpellVarsDto {
private Object coeff;
private List<Double> coeff = new ArrayList<>();
private String dyn;
private String key;
private String link;

public Object getCoeff() {
public List<Double> getCoeff() {
return coeff;
}

public void setCoeff(Object coeff) {
this.coeff = coeff;
}

public String getDyn() {
return dyn;
}
Expand Down
Loading

0 comments on commit 90c4088

Please sign in to comment.