Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ApiHandler#getLeagueEntries #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions rest/src/main/java/net/boreeas/riotapi/rest/ApiHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ private Map<Long, List<LeagueList>> getLeaguesVarArgs(long... summoners) {
* @return A list of league entries
* @see <a href=https://developer.riotgames.com/api/methods#!/593/1863>Official API documentation</a>
*/
public List<LeagueItem> getLeagueEntries(long summoner) {
public List<LeagueList> getLeagueEntries(long summoner) {
return getLeagueItemsVarArgs(summoner).get(summoner);
}

Expand All @@ -228,12 +228,12 @@ public List<LeagueItem> getLeagueEntries(long summoner) {
* @return A map, mapping summoner ids to lists of league entries for that summoner
* @see <a href=https://developer.riotgames.com/api/methods#!/593/1863>Official API documentation</a>
*/
public Map<Long, List<LeagueItem>> getLeagueEntries(long... summoners) {
public Map<Long, List<LeagueList>> getLeagueEntries(long... summoners) {
return getLeagueItemsVarArgs(summoners);
}

private Map<Long, List<LeagueItem>> getLeagueItemsVarArgs(long... summoners) {
Type type = new TypeToken<Map<Long, List<LeagueItem>>>() {
private Map<Long, List<LeagueList>> getLeagueItemsVarArgs(long... summoners) {
Type type = new TypeToken<Map<Long, List<LeagueList>>>() {
}.getType();
WebTarget tgt = leagueInfoTarget.path("by-summoner/" + concat(summoners)).path("entry");
return gson.fromJson($(tgt), type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public Future<Map<Long, List<LeagueList>>> getLeagues(long... summoners) {
* @return A list of league entries
* @see <a href=https://developer.riotgames.com/api/methods#!/593/1863>Official API documentation</a>
*/
public Future<List<LeagueItem>> getLeagueEntries(long summoner) {
public Future<List<LeagueList>> getLeagueEntries(long summoner) {
return new ApiFuture<>(() -> handler.getLeagueEntries(summoner));
}

Expand All @@ -252,7 +252,7 @@ public Future<List<LeagueItem>> getLeagueEntries(long summoner) {
* @return A map, mapping summoner ids to lists of league entries for that summoner
* @see <a href=https://developer.riotgames.com/api/methods#!/593/1863>Official API documentation</a>
*/
public Future<Map<Long, List<LeagueItem>>> getLeagueEntries(long... summoners) {
public Future<Map<Long, List<LeagueList>>> getLeagueEntries(long... summoners) {
return new ApiFuture<>(() -> handler.getLeagueEntries(summoners));
}

Expand Down