Skip to content

Commit

Permalink
Namespace change to satisfy maven requirements and bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
robrua committed Sep 8, 2014
1 parent 8f1f53a commit 4fa40f4
Show file tree
Hide file tree
Showing 90 changed files with 270 additions and 262 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ Here's some examples of a few simple uses of the API. The full JavaDoc can be fo
```java
import java.util.List;

import lib.orianna.api.RateLimiter;
import lib.orianna.api.RiotAPI;
import lib.orianna.api.queryspecs.Region;
import lib.orianna.type.league.League;
import lib.orianna.type.league.LeagueType;
import lib.orianna.type.staticdata.Champion;
import lib.orianna.type.summoner.Summoner;
import com.robrua.orianna.api.RateLimiter;
import com.robrua.orianna.api.RiotAPI;
import com.robrua.orianna.api.queryspecs.Region;
import com.robrua.orianna.type.league.League;
import com.robrua.orianna.type.league.LeagueType;
import com.robrua.orianna.type.staticdata.Champion;
import com.robrua.orianna.type.summoner.Summoner;

public class Example {
public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lib.orianna.api;
package com.robrua.orianna.api;

/**
* Encapsulates all common error conditions from the API
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lib.orianna.api;
package com.robrua.orianna.api;

import java.time.Duration;
import java.time.LocalDateTime;
Expand All @@ -16,87 +16,87 @@
import java.util.regex.Pattern;
import java.util.stream.Collectors;

import lib.orianna.api.queryspecs.Region;
import lib.orianna.api.queryspecs.Season;
import lib.orianna.type.champion.ChampionStatus;
import lib.orianna.type.game.Game;
import lib.orianna.type.game.GameMode;
import lib.orianna.type.game.GamePlayer;
import lib.orianna.type.game.GameType;
import lib.orianna.type.game.RawStats;
import lib.orianna.type.game.SubType;
import lib.orianna.type.league.League;
import lib.orianna.type.league.LeagueEntry;
import lib.orianna.type.league.LeagueType;
import lib.orianna.type.league.MiniSeries;
import lib.orianna.type.league.Tier;
import lib.orianna.type.match.BannedChampion;
import lib.orianna.type.match.BuildingType;
import lib.orianna.type.match.Event;
import lib.orianna.type.match.EventType;
import lib.orianna.type.match.Frame;
import lib.orianna.type.match.Lane;
import lib.orianna.type.match.LaneType;
import lib.orianna.type.match.LevelUpType;
import lib.orianna.type.match.MatchMap;
import lib.orianna.type.match.MatchSummary;
import lib.orianna.type.match.MatchTeam;
import lib.orianna.type.match.MatchTimeline;
import lib.orianna.type.match.MonsterType;
import lib.orianna.type.match.Participant;
import lib.orianna.type.match.ParticipantFrame;
import lib.orianna.type.match.ParticipantStats;
import lib.orianna.type.match.ParticipantTimeline;
import lib.orianna.type.match.ParticipantTimelineData;
import lib.orianna.type.match.Player;
import lib.orianna.type.match.Position;
import lib.orianna.type.match.QueueType;
import lib.orianna.type.match.Role;
import lib.orianna.type.match.Side;
import lib.orianna.type.match.TowerType;
import lib.orianna.type.match.WardType;
import lib.orianna.type.staticdata.BasicDataStats;
import lib.orianna.type.staticdata.Block;
import lib.orianna.type.staticdata.BlockItem;
import lib.orianna.type.staticdata.Champion;
import lib.orianna.type.staticdata.ChampionSpell;
import lib.orianna.type.staticdata.Gold;
import lib.orianna.type.staticdata.Image;
import lib.orianna.type.staticdata.Information;
import lib.orianna.type.staticdata.Item;
import lib.orianna.type.staticdata.LevelTip;
import lib.orianna.type.staticdata.Mastery;
import lib.orianna.type.staticdata.MasteryTree;
import lib.orianna.type.staticdata.MasteryTreeItem;
import lib.orianna.type.staticdata.MasteryTreeList;
import lib.orianna.type.staticdata.MetaData;
import lib.orianna.type.staticdata.Passive;
import lib.orianna.type.staticdata.Realm;
import lib.orianna.type.staticdata.Recommended;
import lib.orianna.type.staticdata.Rune;
import lib.orianna.type.staticdata.RuneType;
import lib.orianna.type.staticdata.Skin;
import lib.orianna.type.staticdata.SpellVariables;
import lib.orianna.type.staticdata.Stats;
import lib.orianna.type.staticdata.SummonerSpell;
import lib.orianna.type.stats.AggregatedStats;
import lib.orianna.type.stats.ChampionStats;
import lib.orianna.type.stats.PlayerStatsSummary;
import lib.orianna.type.stats.PlayerStatsSummaryType;
import lib.orianna.type.summoner.MasteryPage;
import lib.orianna.type.summoner.MasterySlot;
import lib.orianna.type.summoner.RunePage;
import lib.orianna.type.summoner.RuneSlot;
import lib.orianna.type.summoner.Summoner;
import lib.orianna.type.team.MatchHistorySummary;
import lib.orianna.type.team.Roster;
import lib.orianna.type.team.Team;
import lib.orianna.type.team.TeamMemberInformation;
import lib.orianna.type.team.TeamStatDetail;

import org.json.simple.JSONArray;
import org.json.simple.JSONObject;

import com.robrua.orianna.api.queryspecs.Region;
import com.robrua.orianna.api.queryspecs.Season;
import com.robrua.orianna.type.champion.ChampionStatus;
import com.robrua.orianna.type.game.Game;
import com.robrua.orianna.type.game.GameMode;
import com.robrua.orianna.type.game.GamePlayer;
import com.robrua.orianna.type.game.GameType;
import com.robrua.orianna.type.game.RawStats;
import com.robrua.orianna.type.game.SubType;
import com.robrua.orianna.type.league.League;
import com.robrua.orianna.type.league.LeagueEntry;
import com.robrua.orianna.type.league.LeagueType;
import com.robrua.orianna.type.league.MiniSeries;
import com.robrua.orianna.type.league.Tier;
import com.robrua.orianna.type.match.BannedChampion;
import com.robrua.orianna.type.match.BuildingType;
import com.robrua.orianna.type.match.Event;
import com.robrua.orianna.type.match.EventType;
import com.robrua.orianna.type.match.Frame;
import com.robrua.orianna.type.match.Lane;
import com.robrua.orianna.type.match.LaneType;
import com.robrua.orianna.type.match.LevelUpType;
import com.robrua.orianna.type.match.MatchMap;
import com.robrua.orianna.type.match.MatchSummary;
import com.robrua.orianna.type.match.MatchTeam;
import com.robrua.orianna.type.match.MatchTimeline;
import com.robrua.orianna.type.match.MonsterType;
import com.robrua.orianna.type.match.Participant;
import com.robrua.orianna.type.match.ParticipantFrame;
import com.robrua.orianna.type.match.ParticipantStats;
import com.robrua.orianna.type.match.ParticipantTimeline;
import com.robrua.orianna.type.match.ParticipantTimelineData;
import com.robrua.orianna.type.match.Player;
import com.robrua.orianna.type.match.Position;
import com.robrua.orianna.type.match.QueueType;
import com.robrua.orianna.type.match.Role;
import com.robrua.orianna.type.match.Side;
import com.robrua.orianna.type.match.TowerType;
import com.robrua.orianna.type.match.WardType;
import com.robrua.orianna.type.staticdata.BasicDataStats;
import com.robrua.orianna.type.staticdata.Block;
import com.robrua.orianna.type.staticdata.BlockItem;
import com.robrua.orianna.type.staticdata.Champion;
import com.robrua.orianna.type.staticdata.ChampionSpell;
import com.robrua.orianna.type.staticdata.Gold;
import com.robrua.orianna.type.staticdata.Image;
import com.robrua.orianna.type.staticdata.Information;
import com.robrua.orianna.type.staticdata.Item;
import com.robrua.orianna.type.staticdata.LevelTip;
import com.robrua.orianna.type.staticdata.Mastery;
import com.robrua.orianna.type.staticdata.MasteryTree;
import com.robrua.orianna.type.staticdata.MasteryTreeItem;
import com.robrua.orianna.type.staticdata.MasteryTreeList;
import com.robrua.orianna.type.staticdata.MetaData;
import com.robrua.orianna.type.staticdata.Passive;
import com.robrua.orianna.type.staticdata.Realm;
import com.robrua.orianna.type.staticdata.Recommended;
import com.robrua.orianna.type.staticdata.Rune;
import com.robrua.orianna.type.staticdata.RuneType;
import com.robrua.orianna.type.staticdata.Skin;
import com.robrua.orianna.type.staticdata.SpellVariables;
import com.robrua.orianna.type.staticdata.Stats;
import com.robrua.orianna.type.staticdata.SummonerSpell;
import com.robrua.orianna.type.stats.AggregatedStats;
import com.robrua.orianna.type.stats.ChampionStats;
import com.robrua.orianna.type.stats.PlayerStatsSummary;
import com.robrua.orianna.type.stats.PlayerStatsSummaryType;
import com.robrua.orianna.type.summoner.MasteryPage;
import com.robrua.orianna.type.summoner.MasterySlot;
import com.robrua.orianna.type.summoner.RunePage;
import com.robrua.orianna.type.summoner.RuneSlot;
import com.robrua.orianna.type.summoner.Summoner;
import com.robrua.orianna.type.team.MatchHistorySummary;
import com.robrua.orianna.type.team.Roster;
import com.robrua.orianna.type.team.Team;
import com.robrua.orianna.type.team.TeamMemberInformation;
import com.robrua.orianna.type.team.TeamStatDetail;

/**
* Used to convert the responses from the JSONRiotAPI to the Orianna typesystem.
*
Expand Down Expand Up @@ -152,6 +152,10 @@ protected static <T> List<T> getList(final JSONArray list, final Function<Object
}

protected static <T> List<T> getList(final JSONArray list, final Function<Object, T> mapper, final Comparator<? super T> sorter) {
if(list == null) {
return null;
}

final List<T> result = new ArrayList<T>(list.size());
for(final Object obj : list) {
final T item = mapper.apply(obj);
Expand Down Expand Up @@ -969,7 +973,7 @@ private Game getGameFromJSON(final Map<Long, Summoner> players, final JSONObject
return new Game(champion, createDate, fellowPlayers, gameMode, gameType, ID, invalid, IPEarned, level, map, spell1, spell2, stats, subType, team);
}

public lib.orianna.type.game.GamePlayer getGamePlayerFromJSON(final JSONObject playerInfo) {
public com.robrua.orianna.type.game.GamePlayer getGamePlayerFromJSON(final JSONObject playerInfo) {
if(playerInfo == null) {
return null;
}
Expand Down Expand Up @@ -1270,7 +1274,7 @@ public List<MatchSummary> getMatchHistoryFromJSON(final JSONArray matchHistoryIn
final JSONObject matchSummaryInfo = (JSONObject)msi;
final JSONArray participantIdentityList = (JSONArray)matchSummaryInfo.get("participantIdentities");
final List<JSONObject> plrs = getList(participantIdentityList, p -> (JSONObject)((JSONObject)p).get("player"));
final List<String> names = plrs.stream().map((plr) -> (String)plr.get("summonerName")).collect(Collectors.toList());
final List<String> names = plrs.stream().map((plr) -> (String)plr.get("summonerName")).filter((name) -> name != null).collect(Collectors.toList());
summonerNames.addAll(names);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lib.orianna.api;
package com.robrua.orianna.api;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
Expand All @@ -13,16 +13,17 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import com.robrua.orianna.api.queryspecs.ChampionData;
import com.robrua.orianna.api.queryspecs.ItemData;
import com.robrua.orianna.api.queryspecs.MasteryData;
import com.robrua.orianna.api.queryspecs.Region;
import com.robrua.orianna.api.queryspecs.RuneData;
import com.robrua.orianna.api.queryspecs.Season;
import com.robrua.orianna.api.queryspecs.SummonerSpellData;
import com.robrua.orianna.type.league.LeagueType;
import com.robrua.orianna.type.match.QueueType;

import lib.easyjava.net.rest.SimpleRESTClient;
import lib.orianna.api.queryspecs.ChampionData;
import lib.orianna.api.queryspecs.ItemData;
import lib.orianna.api.queryspecs.MasteryData;
import lib.orianna.api.queryspecs.Region;
import lib.orianna.api.queryspecs.RuneData;
import lib.orianna.api.queryspecs.Season;
import lib.orianna.api.queryspecs.SummonerSpellData;
import lib.orianna.type.league.LeagueType;
import lib.orianna.type.match.QueueType;

/**
* Queries the <a href="http://developer.riotgames.com/api/methods">LoL REST
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lib.orianna.api;
package com.robrua.orianna.api;

import java.util.LinkedList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lib.orianna.api;
package com.robrua.orianna.api;

import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -12,39 +12,39 @@
import java.util.function.Function;
import java.util.stream.Collectors;

import lib.orianna.api.queryspecs.ChampionData;
import lib.orianna.api.queryspecs.ItemData;
import lib.orianna.api.queryspecs.MasteryData;
import lib.orianna.api.queryspecs.Region;
import lib.orianna.api.queryspecs.RuneData;
import lib.orianna.api.queryspecs.Season;
import lib.orianna.api.queryspecs.SummonerSpellData;
import lib.orianna.type.champion.ChampionStatus;
import lib.orianna.type.game.Game;
import lib.orianna.type.league.League;
import lib.orianna.type.league.LeagueType;
import lib.orianna.type.match.MatchSummary;
import lib.orianna.type.match.QueueType;
import lib.orianna.type.staticdata.Champion;
import lib.orianna.type.staticdata.Item;
import lib.orianna.type.staticdata.Mastery;
import lib.orianna.type.staticdata.MasteryTree;
import lib.orianna.type.staticdata.Realm;
import lib.orianna.type.staticdata.Rune;
import lib.orianna.type.staticdata.SummonerSpell;
import lib.orianna.type.stats.ChampionStats;
import lib.orianna.type.stats.PlayerStatsSummary;
import lib.orianna.type.stats.PlayerStatsSummaryType;
import lib.orianna.type.summoner.MasteryPage;
import lib.orianna.type.summoner.RunePage;
import lib.orianna.type.summoner.Summoner;
import lib.orianna.type.team.Team;

import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;

import com.robrua.orianna.api.queryspecs.ChampionData;
import com.robrua.orianna.api.queryspecs.ItemData;
import com.robrua.orianna.api.queryspecs.MasteryData;
import com.robrua.orianna.api.queryspecs.Region;
import com.robrua.orianna.api.queryspecs.RuneData;
import com.robrua.orianna.api.queryspecs.Season;
import com.robrua.orianna.api.queryspecs.SummonerSpellData;
import com.robrua.orianna.type.champion.ChampionStatus;
import com.robrua.orianna.type.game.Game;
import com.robrua.orianna.type.league.League;
import com.robrua.orianna.type.league.LeagueType;
import com.robrua.orianna.type.match.MatchSummary;
import com.robrua.orianna.type.match.QueueType;
import com.robrua.orianna.type.staticdata.Champion;
import com.robrua.orianna.type.staticdata.Item;
import com.robrua.orianna.type.staticdata.Mastery;
import com.robrua.orianna.type.staticdata.MasteryTree;
import com.robrua.orianna.type.staticdata.Realm;
import com.robrua.orianna.type.staticdata.Rune;
import com.robrua.orianna.type.staticdata.SummonerSpell;
import com.robrua.orianna.type.stats.ChampionStats;
import com.robrua.orianna.type.stats.PlayerStatsSummary;
import com.robrua.orianna.type.stats.PlayerStatsSummaryType;
import com.robrua.orianna.type.summoner.MasteryPage;
import com.robrua.orianna.type.summoner.RunePage;
import com.robrua.orianna.type.summoner.Summoner;
import com.robrua.orianna.type.team.Team;

/**
* Accesses the <a href="http://developer.riotgames.com/api/methods">LoL REST
* API</a> and provides results in easy-to-use Java objects.
Expand Down Expand Up @@ -1906,6 +1906,10 @@ public List<Rune> getRunes() {
* API Specification</a>
*/
public Summoner getSummoner(final String summonerName) {
if(summonerName == null) {
return null;
}

Summoner summoner = cache.summonerNames.get(summonerName);

if(summoner == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lib.orianna.api.queryspecs;
package com.robrua.orianna.api.queryspecs;

public enum ChampionData {
all, allytips, altimages, blurb, enemytips, image, info, lore, partype, passive, recommended, skins, spells, stats, tags
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lib.orianna.api.queryspecs;
package com.robrua.orianna.api.queryspecs;

public enum ItemData {
all, colloq, consumed, consumeOnFull, depth, from, gold, groups, hideFromAll, image, inStore, into, maps, requiredChampion, sanitizedDescription, specialRecipe, stacks, stats, tags, tree
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lib.orianna.api.queryspecs;
package com.robrua.orianna.api.queryspecs;

public enum MasteryData {
all, image, prereq, ranks, sanitizedDescription, tree
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lib.orianna.api.queryspecs;
package com.robrua.orianna.api.queryspecs;

public enum Region {
BR, EUNE, EUW, KR, LAN, LAS, NA, OCE, RU, TR
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lib.orianna.api.queryspecs;
package com.robrua.orianna.api.queryspecs;

public enum RuneData {
all, colloq, consumed, consumeOnFull, depth, from, gold, hideFromAll, image, inStore, into, maps, requiredChampion, sanitizedDescription, specialRecipe, stacks, stats, tags
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lib.orianna.api.queryspecs;
package com.robrua.orianna.api.queryspecs;

public enum Season {
PRESEASON3, PRESEASON4, SEASON2014, SEASON3, SEASON4
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package lib.orianna.api.queryspecs;
package com.robrua.orianna.api.queryspecs;

public enum SummonerSpellData {
all, cooldown, cooldownBurn, cost, costBurn, costType, effect, effectBurn, image, key, leveltip, maxrank, modes, range, rangeBurn, resource, sanitizedDescription, sanitizedTooltip, tooltip, vars
Expand Down
Loading

0 comments on commit 4fa40f4

Please sign in to comment.