From d2eda62d7d138aec4a1fbdbb6afdd2db40ebaa27 Mon Sep 17 00:00:00 2001 From: MiniClem Date: Fri, 22 Feb 2019 23:10:11 +0100 Subject: [PATCH 01/46] Moved java files in request package It exists many dependencies between the main java and all the requests classes/methods, I had to change some classes and method to public from package-private due to this. We'll see if we can come back to something less permissive --- src/main/java/me/xhsun/guildwars2wrapper/GuildWars2.java | 5 ++++- .../{ => requests}/AsynchronousRequest.java | 5 +++-- .../guildwars2wrapper/{ => requests}/GuildWars2API.java | 4 ++-- .../me/xhsun/guildwars2wrapper/{ => requests}/Request.java | 2 +- .../guildwars2wrapper/{ => requests}/SynchronousRequest.java | 5 +++-- .../me/xhsun/guildwars2wrapper/v1/GuildWars2V1URLTest.java | 2 +- .../xhsun/guildwars2wrapper/v2/GuildWars2V2AuthURLTest.java | 2 +- .../me/xhsun/guildwars2wrapper/v2/GuildWars2V2URLTest.java | 2 +- 8 files changed, 16 insertions(+), 11 deletions(-) rename src/main/java/me/xhsun/guildwars2wrapper/{ => requests}/AsynchronousRequest.java (99%) rename src/main/java/me/xhsun/guildwars2wrapper/{ => requests}/GuildWars2API.java (99%) rename src/main/java/me/xhsun/guildwars2wrapper/{ => requests}/Request.java (98%) rename src/main/java/me/xhsun/guildwars2wrapper/{ => requests}/SynchronousRequest.java (99%) diff --git a/src/main/java/me/xhsun/guildwars2wrapper/GuildWars2.java b/src/main/java/me/xhsun/guildwars2wrapper/GuildWars2.java index 4f3f5b5..c4eb2f6 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/GuildWars2.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/GuildWars2.java @@ -2,6 +2,9 @@ import me.xhsun.guildwars2wrapper.error.ErrorCode; import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.requests.AsynchronousRequest; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.SynchronousRequest; import okhttp3.Cache; import okhttp3.OkHttpClient; import retrofit2.Retrofit; @@ -36,7 +39,7 @@ public String getValue() { } private static final String API = "https://api.guildwars2.com"; private static volatile GuildWars2 instance = null; - static volatile LanguageSelect lang = LanguageSelect.English; + public static volatile LanguageSelect lang = LanguageSelect.English; private volatile GuildWars2API gw2API; private volatile SynchronousRequest synchronous; private volatile AsynchronousRequest asynchronous; diff --git a/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/AsynchronousRequest.java similarity index 99% rename from src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java rename to src/main/java/me/xhsun/guildwars2wrapper/requests/AsynchronousRequest.java index d13a951..7e06028 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/AsynchronousRequest.java @@ -1,5 +1,6 @@ -package me.xhsun.guildwars2wrapper; +package me.xhsun.guildwars2wrapper.requests; +import me.xhsun.guildwars2wrapper.GuildWars2; import me.xhsun.guildwars2wrapper.error.ErrorCode; import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; import me.xhsun.guildwars2wrapper.model.v1.AllWvWMatchOverview; @@ -48,7 +49,7 @@ */ public class AsynchronousRequest extends Request { - AsynchronousRequest(GuildWars2API gw2API) { + public AsynchronousRequest(GuildWars2API gw2API) { super(gw2API); } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/GuildWars2API.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/GuildWars2API.java similarity index 99% rename from src/main/java/me/xhsun/guildwars2wrapper/GuildWars2API.java rename to src/main/java/me/xhsun/guildwars2wrapper/requests/GuildWars2API.java index 10bf0a6..b335dc9 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/GuildWars2API.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/GuildWars2API.java @@ -1,4 +1,4 @@ -package me.xhsun.guildwars2wrapper; +package me.xhsun.guildwars2wrapper.requests; import java.util.*; @@ -27,7 +27,7 @@ * @author xhsun * @since 2017-02-07 */ -interface GuildWars2API { +public interface GuildWars2API { //API:1 //Event Detail (lang) @GET("/v1/event_details.json") diff --git a/src/main/java/me/xhsun/guildwars2wrapper/Request.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/Request.java similarity index 98% rename from src/main/java/me/xhsun/guildwars2wrapper/Request.java rename to src/main/java/me/xhsun/guildwars2wrapper/requests/Request.java index 3b8d834..c666e20 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/Request.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/Request.java @@ -1,4 +1,4 @@ -package me.xhsun.guildwars2wrapper; +package me.xhsun.guildwars2wrapper.requests; import me.xhsun.guildwars2wrapper.error.ErrorCode; import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; diff --git a/src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/SynchronousRequest.java similarity index 99% rename from src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java rename to src/main/java/me/xhsun/guildwars2wrapper/requests/SynchronousRequest.java index 4ec9082..ea6b06d 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/SynchronousRequest.java @@ -1,5 +1,6 @@ -package me.xhsun.guildwars2wrapper; +package me.xhsun.guildwars2wrapper.requests; +import me.xhsun.guildwars2wrapper.GuildWars2; import me.xhsun.guildwars2wrapper.error.ErrorCode; import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; import me.xhsun.guildwars2wrapper.model.v1.AllWvWMatchOverview; @@ -44,7 +45,7 @@ */ public class SynchronousRequest extends Request { - SynchronousRequest(GuildWars2API gw2API) { + public SynchronousRequest(GuildWars2API gw2API) { super(gw2API); } diff --git a/src/test/java/me/xhsun/guildwars2wrapper/v1/GuildWars2V1URLTest.java b/src/test/java/me/xhsun/guildwars2wrapper/v1/GuildWars2V1URLTest.java index 6797373..36086ca 100755 --- a/src/test/java/me/xhsun/guildwars2wrapper/v1/GuildWars2V1URLTest.java +++ b/src/test/java/me/xhsun/guildwars2wrapper/v1/GuildWars2V1URLTest.java @@ -1,7 +1,7 @@ package me.xhsun.guildwars2wrapper.v1; import me.xhsun.guildwars2wrapper.GuildWars2; -import me.xhsun.guildwars2wrapper.SynchronousRequest; +import me.xhsun.guildwars2wrapper.requests.SynchronousRequest; import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; import me.xhsun.guildwars2wrapper.model.v1.AllWvWMatchOverview; import me.xhsun.guildwars2wrapper.model.v1.EventDetail; diff --git a/src/test/java/me/xhsun/guildwars2wrapper/v2/GuildWars2V2AuthURLTest.java b/src/test/java/me/xhsun/guildwars2wrapper/v2/GuildWars2V2AuthURLTest.java index bcd899d..98cbe6c 100755 --- a/src/test/java/me/xhsun/guildwars2wrapper/v2/GuildWars2V2AuthURLTest.java +++ b/src/test/java/me/xhsun/guildwars2wrapper/v2/GuildWars2V2AuthURLTest.java @@ -1,7 +1,7 @@ package me.xhsun.guildwars2wrapper.v2; import me.xhsun.guildwars2wrapper.GuildWars2; -import me.xhsun.guildwars2wrapper.SynchronousRequest; +import me.xhsun.guildwars2wrapper.requests.SynchronousRequest; import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; import me.xhsun.guildwars2wrapper.model.v2.Cat; import me.xhsun.guildwars2wrapper.model.v2.TokenInfo; diff --git a/src/test/java/me/xhsun/guildwars2wrapper/v2/GuildWars2V2URLTest.java b/src/test/java/me/xhsun/guildwars2wrapper/v2/GuildWars2V2URLTest.java index 5d8e94c..e870c3a 100755 --- a/src/test/java/me/xhsun/guildwars2wrapper/v2/GuildWars2V2URLTest.java +++ b/src/test/java/me/xhsun/guildwars2wrapper/v2/GuildWars2V2URLTest.java @@ -1,7 +1,7 @@ package me.xhsun.guildwars2wrapper.v2; import me.xhsun.guildwars2wrapper.GuildWars2; -import me.xhsun.guildwars2wrapper.SynchronousRequest; +import me.xhsun.guildwars2wrapper.requests.SynchronousRequest; import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; import me.xhsun.guildwars2wrapper.model.v2.Emblem; import me.xhsun.guildwars2wrapper.model.v2.World; From 3efe99d1bd4960f1b02fd88ae31235477a08967e Mon Sep 17 00:00:00 2001 From: MiniClem Date: Sun, 24 Feb 2019 18:42:55 +0100 Subject: [PATCH 02/46] Protected access need for Request childs --- .../guildwars2wrapper/requests/Request.java | 18 +++++++++--------- .../requests/v1/EventDetails.java | 5 +++++ .../requests/v1/MapNames.java | 5 +++++ .../requests/v1/WorldNames.java | 5 +++++ .../requests/v1/wvw/Matches.java | 5 +++++ .../requests/v1/wvw/ObjectiveNames.java | 5 +++++ .../requests/v2/TokenInfo.java | 5 +++++ .../requests/v2/account/Account.java | 5 +++++ .../requests/v2/account/Achievements.java | 5 +++++ .../requests/v2/account/Bank.java | 5 +++++ .../requests/v2/account/Dungeons.java | 5 +++++ .../requests/v2/account/Dyes.java | 5 +++++ .../requests/v2/account/Finishers.java | 5 +++++ 13 files changed, 69 insertions(+), 9 deletions(-) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v1/EventDetails.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v1/MapNames.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v1/WorldNames.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/Matches.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/ObjectiveNames.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/TokenInfo.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Account.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Achievements.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Bank.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dungeons.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dyes.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Finishers.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/Request.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/Request.java index c666e20..7c8608f 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/Request.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/Request.java @@ -14,35 +14,35 @@ * @since 2017-06-04 */ -abstract class Request { - GuildWars2API gw2API; +public abstract class Request { + protected GuildWars2API gw2API; - Request(GuildWars2API gw2API) { + protected Request(GuildWars2API gw2API) { this.gw2API = gw2API; } //convert list of ids to comma separated list - String processIds(int[] list) throws GuildWars2Exception { + protected String processIds(int[] list) throws GuildWars2Exception { if (list.length > 200) throw new GuildWars2Exception(ErrorCode.ID, "Exceeded upper limit (200 ids) for id list"); StringBuilder ids = new StringBuilder(); for (int id : list) ids.append(id).append(","); return ids.toString().trim().substring(0, ids.length() - 1); } - String processIds(String[] list) throws GuildWars2Exception { + protected String processIds(String[] list) throws GuildWars2Exception { if (list.length > 200) throw new GuildWars2Exception(ErrorCode.ID, "Exceeded upper limit (200 ids) for id list"); StringBuilder ids = new StringBuilder(); for (String id : list) ids.append(id).append(","); return ids.toString().trim().substring(0, ids.length() - 1); } - void isValueValid(long value) throws GuildWars2Exception { + protected void isValueValid(long value) throws GuildWars2Exception { if (value > 0) return; throw new GuildWars2Exception(ErrorCode.Other, "Invalid Value"); } //throw error base on error code and error response - void throwError(int code, ResponseBody body) throws GuildWars2Exception { + protected void throwError(int code, ResponseBody body) throws GuildWars2Exception { try { String respond; if (body == null) respond = ""; @@ -55,7 +55,7 @@ void throwError(int code, ResponseBody body) throws GuildWars2Exception { } //check if parameters are valid or not - void isParamValid(ParamChecker... items) throws GuildWars2Exception { + protected void isParamValid(ParamChecker... items) throws GuildWars2Exception { for (ParamChecker c : items) { if (c.type != ParamType.IDS && c.type != ParamType.STR_IDS) { if (c.value == null || c.value.equals("")) { @@ -90,7 +90,7 @@ void isParamValid(ParamChecker... items) throws GuildWars2Exception { } //for helping with throwing appropriate if parameters are invalid - class ParamChecker { + protected class ParamChecker { ParamType type; String value; int[] ids; diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/EventDetails.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/EventDetails.java new file mode 100644 index 0000000..eab424c --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/EventDetails.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v1.wvw; + +public class EventDetail { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/MapNames.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/MapNames.java new file mode 100644 index 0000000..8bfbbd8 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/MapNames.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v1.wvw; + +public class MapNames { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/WorldNames.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/WorldNames.java new file mode 100644 index 0000000..6bb61a2 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/WorldNames.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v1; + +public class WorldNames { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/Matches.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/Matches.java new file mode 100644 index 0000000..eac9a4b --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/Matches.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v1.wvw; + +public class Matches { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/ObjectiveNames.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/ObjectiveNames.java new file mode 100644 index 0000000..7cffa0a --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/ObjectiveNames.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v1.wvw; + +public class ObjectiveNames { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/TokenInfo.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/TokenInfo.java new file mode 100644 index 0000000..215e8aa --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/TokenInfo.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2; + +public class TokenInfo { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Account.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Account.java new file mode 100644 index 0000000..cd260be --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Account.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account; + +public class Account { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Achievements.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Achievements.java new file mode 100644 index 0000000..d27dee5 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Achievements.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account; + +public class Achievements { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Bank.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Bank.java new file mode 100644 index 0000000..289a51a --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Bank.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account; + +public class Bank { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dungeons.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dungeons.java new file mode 100644 index 0000000..758de13 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dungeons.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account; + +public class Dungeons { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dyes.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dyes.java new file mode 100644 index 0000000..a218944 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dyes.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account; + +public class Dyes { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Finishers.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Finishers.java new file mode 100644 index 0000000..c45eff2 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Finishers.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account; + +public class Finishers { + +} From 286349f6650dede4c6df67c042ac1843aafba78a Mon Sep 17 00:00:00 2001 From: MiniClem Date: Sun, 24 Feb 2019 18:45:16 +0100 Subject: [PATCH 03/46] method accessor --- src/main/java/me/xhsun/guildwars2wrapper/requests/Request.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/Request.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/Request.java index 7c8608f..361a50c 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/Request.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/Request.java @@ -112,5 +112,5 @@ protected class ParamChecker { } } - enum ParamType {API, CHAR, GUILD, ID, IDS, STR_IDS} + protected enum ParamType {API, CHAR, GUILD, ID, IDS, STR_IDS} } From c2996ed7a9de9ab567b4d1b618d635cf4d76291b Mon Sep 17 00:00:00 2001 From: MiniClem Date: Sun, 24 Feb 2019 18:53:34 +0100 Subject: [PATCH 04/46] v1 refactor --- .../guildwars2wrapper/requests/Request.java | 6 +- .../requests/v1/EventDetails.java | 81 ++++++++++++++++++- .../requests/v1/MapNames.java | 49 ++++++++++- .../requests/v1/WorldNames.java | 47 ++++++++++- .../requests/v1/wvw/Matches.java | 48 ++++++++++- .../requests/v1/wvw/ObjectiveNames.java | 47 ++++++++++- .../requests/v2/account/Account.java | 4 +- 7 files changed, 271 insertions(+), 11 deletions(-) diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/Request.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/Request.java index 361a50c..db7c7d5 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/Request.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/Request.java @@ -96,17 +96,17 @@ protected class ParamChecker { int[] ids; String[] str_id; - ParamChecker(ParamType t, String s) { + public ParamChecker(ParamType t, String s) { type = t; value = s; } - ParamChecker(int[] i) { + protected ParamChecker(int[] i) { type = ParamType.IDS; ids = i; } - ParamChecker(String[] i) { + protected ParamChecker(String[] i) { type = ParamType.STR_IDS; str_id = i; } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/EventDetails.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/EventDetails.java index eab424c..3c2bffe 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/EventDetails.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/EventDetails.java @@ -1,5 +1,82 @@ -package me.xhsun.guildwars2wrapper.requests.v1.wvw; +package me.xhsun.guildwars2wrapper.requests.v1; -public class EventDetail { +import java.io.IOException; +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.ErrorCode; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v1.EventDetail; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class EventDetails extends Request { + + protected EventDetails(GuildWars2API gw2API) { + super(gw2API); + } + + // ASYNC + /** + * For more info on event detail API go here
+ * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is null + * @see EventDetail event detail + */ + public void getAllEventDetailedInfo(Callback callback) throws NullPointerException { + gw2API.getAllEventDetailedInfo(GuildWars2.lang.getValue()).enqueue(callback); + } + + /** + * For more info on event detail API go here
+ * + * @param id event id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid id + * @throws NullPointerException if given {@link Callback} is null + * @see EventDetail event detail + */ + public void getEventDetailedInfo(String id, Callback callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.ID, id)); + gw2API.getEventDetailedInfo(id, GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC + /** + * For more info on event detail API go here
+ * + * @return event details + * @throws GuildWars2Exception see {@link ErrorCode} for detail + * @see EventDetail event detail + */ + public EventDetail getAllEventDetailedInfo() throws GuildWars2Exception { + try { + Response response = gw2API.getAllEventDetailedInfo(GuildWars2.lang.getValue()).execute(); + if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); + return response.body(); + } catch (IOException e) { + throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); + } + } + + /** + * For more info on event detail API go here
+ * + * @param id event id + * @return event details + * @throws GuildWars2Exception see {@link ErrorCode} for detail + * @see EventDetail event detail + */ + public EventDetail getEventDetailedInfo(String id) throws GuildWars2Exception { + isParamValid(new ParamChecker(ParamType.ID, id)); + try { + Response response = gw2API.getEventDetailedInfo(id, GuildWars2.lang.getValue()).execute(); + if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); + return response.body(); + } catch (IOException e) { + throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); + } + } } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/MapNames.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/MapNames.java index 8bfbbd8..a17a19a 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/MapNames.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/MapNames.java @@ -1,5 +1,50 @@ -package me.xhsun.guildwars2wrapper.requests.v1.wvw; +package me.xhsun.guildwars2wrapper.requests.v1; -public class MapNames { +import java.io.IOException; +import java.util.List; +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.ErrorCode; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v1.SimpleName; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class MapNames extends Request { + + protected MapNames(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on map names API go here
+ * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is null + * @see SimpleName map name + */ + public void getAllMapNames(Callback> callback) throws NullPointerException { + gw2API.getAllMapNames(GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC + /** + * For more info on map name API go here
+ * + * @return list of names + * @throws GuildWars2Exception see {@link ErrorCode} for detail + * @see SimpleName map name + */ + public List getAllMapNames() throws GuildWars2Exception { + try { + Response> response = gw2API.getAllMapNames(GuildWars2.lang.getValue()).execute(); + if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); + return response.body(); + } catch (IOException e) { + throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); + } + } } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/WorldNames.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/WorldNames.java index 6bb61a2..112cfdc 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/WorldNames.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/WorldNames.java @@ -1,5 +1,50 @@ package me.xhsun.guildwars2wrapper.requests.v1; -public class WorldNames { +import java.io.IOException; +import java.util.List; +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.ErrorCode; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v1.SimpleName; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class WorldNames extends Request { + + protected WorldNames(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on world names API go here
+ * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is null + * @see SimpleName world name + */ + public void getAllWorldNames(Callback> callback) throws NullPointerException { + gw2API.getAllWorldNames(GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC + /** + * For more info on world name API go here
+ * + * @return list of names + * @throws GuildWars2Exception see {@link ErrorCode} for detail + * @see SimpleName world name + */ + public List getAllWorldNames() throws GuildWars2Exception { + try { + Response> response = gw2API.getAllWorldNames(GuildWars2.lang.getValue()).execute(); + if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); + return response.body(); + } catch (IOException e) { + throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); + } + } } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/Matches.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/Matches.java index eac9a4b..6c919b9 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/Matches.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/Matches.java @@ -1,5 +1,51 @@ package me.xhsun.guildwars2wrapper.requests.v1.wvw; -public class Matches { +import java.io.IOException; +import java.util.List; +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.ErrorCode; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v1.AllWvWMatchOverview; +import me.xhsun.guildwars2wrapper.model.v1.SimpleName; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class Matches extends Request { + + protected Matches(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on WvW objective names API go here
+ * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is null + * @see SimpleName objective name + */ + public void getAllWvWObjectiveNames(Callback> callback) throws NullPointerException { + gw2API.getAllWvWObjectiveNames(GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC + /** + * For more info on v1 wvw matches API go here
+ * + * @return simple wvw matches info + * @throws GuildWars2Exception see {@link ErrorCode} for detail + * @see AllWvWMatchOverview wvw matches + */ + public AllWvWMatchOverview getAllWvWMatchOverview() throws GuildWars2Exception { + try { + Response response = gw2API.getAllWvWMatchOverview().execute(); + if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); + return response.body(); + } catch (IOException e) { + throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); + } + } } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/ObjectiveNames.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/ObjectiveNames.java index 7cffa0a..e2fc3c8 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/ObjectiveNames.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/ObjectiveNames.java @@ -1,5 +1,50 @@ package me.xhsun.guildwars2wrapper.requests.v1.wvw; -public class ObjectiveNames { +import java.io.IOException; +import java.util.List; +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.ErrorCode; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v1.SimpleName; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class ObjectiveNames extends Request { + + protected ObjectiveNames(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on WvW objective names API go here
+ * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is null + * @see SimpleName objective name + */ + public void getAllWvWObjectiveNames(Callback> callback) throws NullPointerException { + gw2API.getAllWvWObjectiveNames(GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC + /** + * For more info on WvW objective API go here
+ * + * @return list of names + * @throws GuildWars2Exception see {@link ErrorCode} for detail + * @see SimpleName objective name + */ + public List getAllWvWObjectiveNames() throws GuildWars2Exception { + try { + Response> response = gw2API.getAllWvWObjectiveNames(GuildWars2.lang.getValue()).execute(); + if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); + return response.body(); + } catch (IOException e) { + throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); + } + } } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Account.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Account.java index cd260be..2697dd1 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Account.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Account.java @@ -1,5 +1,7 @@ package me.xhsun.guildwars2wrapper.requests.v2.account; -public class Account { +import me.xhsun.guildwars2wrapper.requests.Request; + +public class Account extends Request { } From d1e1187c1f352bac893ebee57f70d930466af530 Mon Sep 17 00:00:00 2001 From: MiniClem Date: Sun, 24 Feb 2019 19:10:23 +0100 Subject: [PATCH 05/46] v2 Token Info --- .../requests/v2/TokenInfo.java | 51 ++++++++++++++++++- .../requests/v2/account/Gliders.java | 5 ++ .../requests/v2/account/Inventory.java | 5 ++ .../requests/v2/account/Mailcarriers.java | 5 ++ .../requests/v2/account/Masteries.java | 5 ++ .../requests/v2/account/Materials.java | 5 ++ .../requests/v2/account/Minis.java | 5 ++ .../requests/v2/account/Outfits.java | 5 ++ .../requests/v2/account/Raids.java | 5 ++ .../requests/v2/account/Recipes.java | 5 ++ .../requests/v2/account/Skins.java | 5 ++ .../requests/v2/account/Titles.java | 5 ++ .../requests/v2/account/Wallet.java | 5 ++ .../requests/v2/account/home/Cats.java | 5 ++ .../requests/v2/account/home/Materials.java | 5 ++ .../requests/v2/account/home/Nodes.java | 5 ++ .../requests/v2/account/pvp/Heroes.java | 5 ++ 17 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Gliders.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Inventory.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Mailcarriers.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Masteries.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Materials.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Minis.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Outfits.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Raids.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Recipes.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Skins.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Titles.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Wallet.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Cats.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Materials.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Nodes.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/pvp/Heroes.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/TokenInfo.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/TokenInfo.java index 215e8aa..d8f6e1b 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/TokenInfo.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/TokenInfo.java @@ -1,5 +1,54 @@ package me.xhsun.guildwars2wrapper.requests.v2; -public class TokenInfo { +import java.io.IOException; +import me.xhsun.guildwars2wrapper.error.ErrorCode; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class TokenInfo extends Request { + + protected TokenInfo(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on TokenInfo API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is null + * @see me.xhsun.guildwars2wrapper.model.v2.TokenInfo API info + */ + public void getAPIInfo(String API, Callback callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getAPIInfo(API).enqueue(callback); + } + + //SYNC + /** + * For more info on TokenInfo API go here
+ * Get detailed info related to this API key from server + * + * @param API API key + * @return API info + * @throws GuildWars2Exception see {@link ErrorCode} for detail + * @see me.xhsun.guildwars2wrapper.model.v2.TokenInfo API info + */ + public me.xhsun.guildwars2wrapper.model.v2.TokenInfo getAPIInfo(String API) throws GuildWars2Exception { + isParamValid(new ParamChecker(ParamType.API, API)); + try { + Response response = gw2API.getAPIInfo(API).execute(); + if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); + return response.body(); + } catch (IOException e) { + throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); + } + } } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Gliders.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Gliders.java new file mode 100644 index 0000000..b0bde36 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Gliders.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account; + +public class Gliders { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Inventory.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Inventory.java new file mode 100644 index 0000000..38dd47c --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Inventory.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account; + +public class Inventory { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Mailcarriers.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Mailcarriers.java new file mode 100644 index 0000000..66ad745 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Mailcarriers.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account; + +public class Mailcarriers { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Masteries.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Masteries.java new file mode 100644 index 0000000..282cac1 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Masteries.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account; + +public class Masteries { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Materials.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Materials.java new file mode 100644 index 0000000..20ceb2d --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Materials.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account; + +public class Materials { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Minis.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Minis.java new file mode 100644 index 0000000..40da65c --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Minis.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account; + +public class Minis { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Outfits.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Outfits.java new file mode 100644 index 0000000..ed1ac44 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Outfits.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account; + +public class Outfits { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Raids.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Raids.java new file mode 100644 index 0000000..dad2d57 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Raids.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account; + +public class Raids { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Recipes.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Recipes.java new file mode 100644 index 0000000..0aabe51 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Recipes.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account; + +public class Recipes { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Skins.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Skins.java new file mode 100644 index 0000000..7309605 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Skins.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account; + +public class Skins { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Titles.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Titles.java new file mode 100644 index 0000000..2f8c47a --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Titles.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account; + +public class Titles { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Wallet.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Wallet.java new file mode 100644 index 0000000..f6a82b9 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Wallet.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account; + +public class Wallet { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Cats.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Cats.java new file mode 100644 index 0000000..124b8de --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Cats.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account.home; + +public class Cats { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Materials.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Materials.java new file mode 100644 index 0000000..a9029ab --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Materials.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account.home; + +public class Materials { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Nodes.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Nodes.java new file mode 100644 index 0000000..8cf3ddb --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Nodes.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account.home; + +public class Ndoes { + +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/pvp/Heroes.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/pvp/Heroes.java new file mode 100644 index 0000000..9494cf4 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/pvp/Heroes.java @@ -0,0 +1,5 @@ +package me.xhsun.guildwars2wrapper.requests.v2.account.pvp; + +public class Heroes { + +} From 9605d6c7b1980ed1db4d50c40d19d2f7168c7687 Mon Sep 17 00:00:00 2001 From: MiniClem Date: Sun, 24 Feb 2019 19:10:44 +0100 Subject: [PATCH 06/46] v2 account creation --- .../requests/v2/account/Account.java | 48 +++++++++++++++++ .../requests/v2/account/Achievements.java | 54 ++++++++++++++++++- .../requests/v2/account/Bank.java | 53 +++++++++++++++++- .../requests/v2/account/Dungeons.java | 49 ++++++++++++++++- .../requests/v2/account/Dyes.java | 53 +++++++++++++++++- .../requests/v2/account/Finishers.java | 53 +++++++++++++++++- .../requests/v2/account/Gliders.java | 28 +++++++++- .../requests/v2/account/home/Nodes.java | 2 +- 8 files changed, 333 insertions(+), 7 deletions(-) diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Account.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Account.java index 2697dd1..0ed2e32 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Account.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Account.java @@ -1,7 +1,55 @@ package me.xhsun.guildwars2wrapper.requests.v2.account; +import java.io.IOException; +import me.xhsun.guildwars2wrapper.error.ErrorCode; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; public class Account extends Request { + protected Account(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Account API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see me.xhsun.guildwars2wrapper.model.v2.account.Account Account info + */ + public void getAccountInfo(String API, Callback callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getAccount(API).enqueue(callback); + } + + //SYNC + /** + * For more info on Account API go here
+ * Get detailed info for account link to given API key + * + * @param API API key + * @return account info + * @throws GuildWars2Exception see {@link ErrorCode} for detail + * @see me.xhsun.guildwars2wrapper.model.v2.account.Account Account info + */ + public me.xhsun.guildwars2wrapper.model.v2.account.Account getAccountInfo(String API) throws GuildWars2Exception { + isParamValid(new ParamChecker(ParamType.API, API)); + try { + Response response = gw2API.getAccount(API).execute(); + if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); + return response.body(); + } catch (IOException e) { + throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); + } + } + } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Achievements.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Achievements.java index d27dee5..6d1e1d0 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Achievements.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Achievements.java @@ -1,5 +1,57 @@ package me.xhsun.guildwars2wrapper.requests.v2.account; -public class Achievements { +import java.io.IOException; +import java.util.List; +import me.xhsun.guildwars2wrapper.error.ErrorCode; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.account.AchievementProgression; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Achievements extends Request { + + protected Achievements(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Account API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see AchievementProgression Account achievement info + */ + public void getAchievementProgression(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getAchievementProgression(API).enqueue(callback); + } + + //SYNC + /** + * For more info on Account API go here
+ * Get an account's progress towards all their achievements. + * + * @param API API key + * @return list of account achievement info + * @throws GuildWars2Exception see {@link ErrorCode} for detail + * @see AchievementProgression account achievement info + */ + public List getAchievementProgression(String API) throws GuildWars2Exception { + isParamValid(new ParamChecker(ParamType.API, API)); + try { + Response> response = gw2API.getAchievementProgression(API).execute(); + if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); + return response.body(); + } catch (IOException e) { + throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); + } + } } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Bank.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Bank.java index 289a51a..898d132 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Bank.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Bank.java @@ -1,5 +1,56 @@ package me.xhsun.guildwars2wrapper.requests.v2.account; -public class Bank { +import java.io.IOException; +import java.util.List; +import me.xhsun.guildwars2wrapper.error.ErrorCode; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.util.Inventory; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class Bank extends Request { + + protected Bank(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Bank API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see Inventory Bank info + */ + public void getBank(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getBank(API).enqueue(callback); + } + + //SYNC + /** + * For more info on Bank API go here
+ * Get detailed info for bank linked to given API key + * + * @param API API key + * @return bank info + * @throws GuildWars2Exception see {@link ErrorCode} for detail + * @see Inventory Bank info + */ + public List getBank(String API) throws GuildWars2Exception { + isParamValid(new ParamChecker(ParamType.API, API)); + try { + Response> response = gw2API.getBank(API).execute(); + if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); + return response.body(); + } catch (IOException e) { + throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); + } + } } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dungeons.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dungeons.java index 758de13..fa2fcb4 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dungeons.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dungeons.java @@ -1,5 +1,52 @@ package me.xhsun.guildwars2wrapper.requests.v2.account; -public class Dungeons { +import java.io.IOException; +import java.util.List; +import me.xhsun.guildwars2wrapper.error.ErrorCode; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class Dungeons extends Request { + + protected Dungeons(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Dungeon progression API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getDailyDungeonProgression(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getDailyDungeonProgression(API).enqueue(callback); + } + + //SYNC + /** + * For more info on Dungeon progression API go here
+ * + * @param API API key + * @return an array of strings representing dungeon path names completed since daily dungeon reset + * @throws GuildWars2Exception see {@link ErrorCode} for detail + */ + public List getDailyDungeonProgression(String API) throws GuildWars2Exception { + isParamValid(new ParamChecker(ParamType.API, API)); + try { + Response> response = gw2API.getDailyDungeonProgression(API).execute(); + if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); + return response.body(); + } catch (IOException e) { + throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); + } + } } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dyes.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dyes.java index a218944..10f574b 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dyes.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dyes.java @@ -1,5 +1,56 @@ package me.xhsun.guildwars2wrapper.requests.v2.account; -public class Dyes { +import java.io.IOException; +import java.util.List; +import me.xhsun.guildwars2wrapper.error.ErrorCode; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Color; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class Dyes extends Request { + + protected Dyes(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Account dyes API go here
+ * Get list of unlocked dyes ids linked to given API key + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see Color color info + */ + public void getUnlockedDyes(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedDyes(API).enqueue(callback); + } + + //SYNC + /** + * For more info on Account dyes API go here
+ * Get list of unlocked dyes ids linked to given API key + * + * @param API API key + * @return list of color ids + * @throws GuildWars2Exception see {@link ErrorCode} for detail + * @see Color + */ + public List getUnlockedDyes(String API) throws GuildWars2Exception { + isParamValid(new ParamChecker(ParamType.API, API)); + try { + Response> response = gw2API.getUnlockedDyes(API).execute(); + if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); + return response.body(); + } catch (IOException e) { + throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); + } + } } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Finishers.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Finishers.java index c45eff2..2e9d7c3 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Finishers.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Finishers.java @@ -1,5 +1,56 @@ package me.xhsun.guildwars2wrapper.requests.v2.account; -public class Finishers { +import java.io.IOException; +import java.util.List; +import me.xhsun.guildwars2wrapper.error.ErrorCode; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.account.UnlockedFinisher; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class Finishers extends Request { + + protected Finishers(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Account finishers API go here
+ * Get list of unlocked finishers linked to given API key + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see UnlockedFinisher unlocked finisher info + */ + public void getUnlockedFinishers(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedFinishers(API).enqueue(callback); + } + + //SYNC + /** + * For more info on Account finishers API go here
+ * Get list of unlocked finishers linked to given API key + * + * @param API API key + * @return list of unlocked finisher info + * @throws GuildWars2Exception see {@link ErrorCode} for detail + * @see UnlockedFinisher unlocked finisher info + */ + public List getUnlockedFinishers(String API) throws GuildWars2Exception { + isParamValid(new ParamChecker(ParamType.API, API)); + try { + Response> response = gw2API.getUnlockedFinishers(API).execute(); + if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); + return response.body(); + } catch (IOException e) { + throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); + } + } } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Gliders.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Gliders.java index b0bde36..4c2f34b 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Gliders.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Gliders.java @@ -1,5 +1,31 @@ package me.xhsun.guildwars2wrapper.requests.v2.account; -public class Gliders { +import java.util.List; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; + +public class Gliders extends Request { + + protected Gliders(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Account gliders API go here
+ * Get list of unlocked glider id(s) linked to given API key + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getUnlockedGliders(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedGliders(API).enqueue(callback); + } } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Nodes.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Nodes.java index 8cf3ddb..d6768d1 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Nodes.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Nodes.java @@ -1,5 +1,5 @@ package me.xhsun.guildwars2wrapper.requests.v2.account.home; -public class Ndoes { +public class Nodes { } From 238dd316c4a9ad4c5ad29c817e708981ba59a360 Mon Sep 17 00:00:00 2001 From: MiniClem Date: Sun, 24 Feb 2019 19:22:19 +0100 Subject: [PATCH 07/46] Requests /account async --- .../requests/v2/account/Inventory.java | 31 +++++++++++++++++- .../requests/v2/account/Mailcarriers.java | 30 ++++++++++++++++- .../requests/v2/account/Masteries.java | 32 ++++++++++++++++++- .../requests/v2/account/Materials.java | 32 ++++++++++++++++++- .../requests/v2/account/Minis.java | 32 ++++++++++++++++++- .../requests/v2/account/Outfits.java | 30 ++++++++++++++++- .../requests/v2/account/Raids.java | 30 ++++++++++++++++- .../requests/v2/account/Recipes.java | 32 ++++++++++++++++++- .../requests/v2/account/Skins.java | 32 ++++++++++++++++++- .../requests/v2/account/Titles.java | 30 ++++++++++++++++- .../requests/v2/account/Wallet.java | 31 +++++++++++++++++- .../requests/v2/account/home/Cats.java | 31 +++++++++++++++++- .../requests/v2/account/home/Materials.java | 5 --- .../requests/v2/account/home/Nodes.java | 29 ++++++++++++++++- .../requests/v2/account/pvp/Heroes.java | 30 ++++++++++++++++- 15 files changed, 418 insertions(+), 19 deletions(-) delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Materials.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Inventory.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Inventory.java index 38dd47c..0c499af 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Inventory.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Inventory.java @@ -1,5 +1,34 @@ package me.xhsun.guildwars2wrapper.requests.v2.account; -public class Inventory { +import java.util.List; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class Inventory extends Request { + + protected Inventory(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Shared Inventory API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see me.xhsun.guildwars2wrapper.model.v2.util.Inventory shared inventory info + */ + public void getSharedInventory(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getSharedInventory(API).enqueue(callback); + } + + //SYNC } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Mailcarriers.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Mailcarriers.java index 66ad745..8523a44 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Mailcarriers.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Mailcarriers.java @@ -1,5 +1,33 @@ package me.xhsun.guildwars2wrapper.requests.v2.account; -public class Mailcarriers { +import java.util.List; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class Mailcarriers extends Request { + + protected Mailcarriers(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on account mail carrier API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getUnlockedMailCarriers(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedMailCarriers(API).enqueue(callback); + } + + //SYNC } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Masteries.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Masteries.java index 282cac1..b050a52 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Masteries.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Masteries.java @@ -1,5 +1,35 @@ package me.xhsun.guildwars2wrapper.requests.v2.account; -public class Masteries { +import java.util.List; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.account.UnlockedMastery; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class Masteries extends Request { + + protected Masteries(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on account masteries API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see UnlockedMastery unlocked mastery info + */ + public void getUnlockedMasteries(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedMasteries(API).enqueue(callback); + } + + //SYNC } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Materials.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Materials.java index 20ceb2d..cf324ad 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Materials.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Materials.java @@ -1,5 +1,35 @@ package me.xhsun.guildwars2wrapper.requests.v2.account; -public class Materials { +import java.util.List; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.account.MaterialStorage; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class Materials extends Request { + + protected Materials(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on MaterialCategory Storage API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see MaterialStorage material storage info + */ + public void getMaterialStorage(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getMaterialBank(API).enqueue(callback); + } + + //SYNC } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Minis.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Minis.java index 40da65c..4cd9bf4 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Minis.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Minis.java @@ -1,5 +1,35 @@ package me.xhsun.guildwars2wrapper.requests.v2.account; -public class Minis { +import java.util.List; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Mini; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class Minis extends Request { + + protected Minis(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on account minis API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see Mini mini info + */ + public void getUnlockedMinis(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedMinis(API).enqueue(callback); + } + + //SYNC } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Outfits.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Outfits.java index ed1ac44..5f329ef 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Outfits.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Outfits.java @@ -1,5 +1,33 @@ package me.xhsun.guildwars2wrapper.requests.v2.account; -public class Outfits { +import java.util.List; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class Outfits extends Request { + + protected Outfits(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on account outfits API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getUnlockedOutfits(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedOutfits(API).enqueue(callback); + } + + //SYNC } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Raids.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Raids.java index dad2d57..cc3aa15 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Raids.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Raids.java @@ -1,5 +1,33 @@ package me.xhsun.guildwars2wrapper.requests.v2.account; -public class Raids { +import java.util.List; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class Raids extends Request { + + protected Raids(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on account raid API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getWeeklyRaidProgression(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getWeeklyRaidProgression(API).enqueue(callback); + } + + //SYNC } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Recipes.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Recipes.java index 0aabe51..74f8cb9 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Recipes.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Recipes.java @@ -1,5 +1,35 @@ package me.xhsun.guildwars2wrapper.requests.v2.account; -public class Recipes { +import java.util.List; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Recipe; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class Recipes extends Request { + + protected Recipes(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on account recipes API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see Recipe recipe info + */ + public void getUnlockedRecipes(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedRecipes(API).enqueue(callback); + } + + //SYNC } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Skins.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Skins.java index 7309605..152f7a5 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Skins.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Skins.java @@ -1,5 +1,35 @@ package me.xhsun.guildwars2wrapper.requests.v2.account; -public class Skins { +import java.util.List; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Skin; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class Skins extends Request { + + protected Skins(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Account/Skins API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see Skin skin info + */ + public void getUnlockedSkins(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedSkins(API).enqueue(callback); + } + + //SYNC } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Titles.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Titles.java index 2f8c47a..31584b9 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Titles.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Titles.java @@ -1,5 +1,33 @@ package me.xhsun.guildwars2wrapper.requests.v2.account; -public class Titles { +import java.util.List; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class Titles extends Request { + + protected Titles(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Account titles API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getUnlockedTitles(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedTitles(API).enqueue(callback); + } + + //SYNC } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Wallet.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Wallet.java index f6a82b9..1209d1c 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Wallet.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Wallet.java @@ -1,5 +1,34 @@ package me.xhsun.guildwars2wrapper.requests.v2.account; -public class Wallet { +import java.util.List; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class Wallet extends Request { + + protected Wallet(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Wallet API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see me.xhsun.guildwars2wrapper.model.v2.account.Wallet wallet info + */ + public void getWallet(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getWallet(API).enqueue(callback); + } + + //SYNC } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Cats.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Cats.java index 124b8de..972ad08 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Cats.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Cats.java @@ -1,5 +1,34 @@ package me.xhsun.guildwars2wrapper.requests.v2.account.home; -public class Cats { +import java.util.List; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Cat; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +public class Cats extends Request { + + protected Cats(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Account cats API go here
+ * Get list of unlocked cats linked to given API key + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see Cat cat info + */ + public void getUnlockedCats(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedCats(API).enqueue(callback); + } + + //SYNC } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Materials.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Materials.java deleted file mode 100644 index a9029ab..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Materials.java +++ /dev/null @@ -1,5 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account.home; - -public class Materials { - -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Nodes.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Nodes.java index d6768d1..0778f85 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Nodes.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Nodes.java @@ -1,5 +1,32 @@ package me.xhsun.guildwars2wrapper.requests.v2.account.home; -public class Nodes { +import java.util.List; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +public class Nodes extends Request { + + protected Nodes(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Account nodes API go here
+ * Get list of unlocked glider id(s) linked to given API key + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getUnlockedHomeNodes(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedHomeNodes(API).enqueue(callback); + } + + //SYNC } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/pvp/Heroes.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/pvp/Heroes.java index 9494cf4..c3c6924 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/pvp/Heroes.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/pvp/Heroes.java @@ -1,5 +1,33 @@ package me.xhsun.guildwars2wrapper.requests.v2.account.pvp; -public class Heroes { +import java.util.List; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +public class Heroes extends Request { + + protected Heroes(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on account pvp heroes API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getUnlockedPvpHeroes(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedPvpHeroes(API).enqueue(callback); + } + + //SYNC } From 1435160ac7ea80915a677d4879dc00f1799b7a73 Mon Sep 17 00:00:00 2001 From: MiniClem Date: Sun, 24 Feb 2019 19:53:00 +0100 Subject: [PATCH 08/46] Working on v2 async --- .../requests/AsynchronousRequest.java | 1 + .../guildwars2wrapper/requests/Request.java | 4 +- .../v2/achievements/Achievements.java | 50 ++++ .../achievements/Categories/Categories.java | 48 ++++ .../requests/v2/achievements/daily/Daily.java | 44 ++++ .../v2/achievements/groups/Groups.java | 48 ++++ .../requests/v2/backstory/Answers.java | 48 ++++ .../requests/v2/backstory/Questions.java | 48 ++++ .../requests/v2/build/Build.java | 30 +++ .../requests/v2/cats/Cats.java | 47 ++++ .../requests/v2/characters/Characters.java | 247 +++++++++++++++++ .../requests/v2/colors/Colors.java | 48 ++++ .../requests/v2/commerce/Prices.java | 61 +++++ .../requests/v2/commerce/Transactions.java | 40 +++ .../v2/commerce/delivery/Delivery.java | 33 +++ .../requests/v2/commerce/exchange/Coins.java | 35 +++ .../v2/commerce/exchange/Exchange.java | 29 ++ .../requests/v2/continents/Continents.java | 249 ++++++++++++++++++ .../requests/v2/currencies/Currencies.java | 48 ++++ .../requests/v2/dungeons/Dungeons.java | 48 ++++ .../requests/v2/emblem/Emblem.java | 63 +++++ .../requests/v2/files/Files.java | 47 ++++ .../requests/v2/finishers/Finishers.java | 48 ++++ .../requests/v2/gliders/Gliders.java | 48 ++++ 24 files changed, 1410 insertions(+), 2 deletions(-) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/Achievements.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/Categories/Categories.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/daily/Daily.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/groups/Groups.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/backstory/Answers.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/backstory/Questions.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/build/Build.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/cats/Cats.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/characters/Characters.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/colors/Colors.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/Prices.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/Transactions.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/delivery/Delivery.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/exchange/Coins.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/exchange/Exchange.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/continents/Continents.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/currencies/Currencies.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/dungeons/Dungeons.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/emblem/Emblem.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/files/Files.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/finishers/Finishers.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/gliders/Gliders.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/AsynchronousRequest.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/AsynchronousRequest.java index 7e06028..638dbad 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/AsynchronousRequest.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/AsynchronousRequest.java @@ -621,6 +621,7 @@ public void getBackStoryQuestionInfo(int[] ids, Callback gw2API.getBackStoryQuestionInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); } + //Builds /** * For more info on build API go here
* Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/Request.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/Request.java index db7c7d5..d124ef6 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/Request.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/Request.java @@ -101,12 +101,12 @@ public ParamChecker(ParamType t, String s) { value = s; } - protected ParamChecker(int[] i) { + public ParamChecker(int[] i) { type = ParamType.IDS; ids = i; } - protected ParamChecker(String[] i) { + public ParamChecker(String[] i) { type = ParamType.STR_IDS; str_id = i; } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/Achievements.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/Achievements.java new file mode 100644 index 0000000..f3b455c --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/Achievements.java @@ -0,0 +1,50 @@ +package me.xhsun.guildwars2wrapper.requests.v2.achievements; + +import java.util.List; +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.achievement.Achievement; +import me.xhsun.guildwars2wrapper.model.v2.achievement.AchievementCategory; +import me.xhsun.guildwars2wrapper.model.v2.achievement.DailyAchievement; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Achievements extends Request { + + protected Achievements(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on achievement API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Achievement achievement info + */ + public void getAllAchievementID(Callback> callback) throws NullPointerException { + gw2API.getAllAchievementIDs().enqueue(callback); + } + + /** + * For more info on achievement API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of achievement id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see Achievement achievement info + */ + public void getAchievementInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getAchievementInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/Categories/Categories.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/Categories/Categories.java new file mode 100644 index 0000000..d8f8baf --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/Categories/Categories.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.achievements.Categories; + +import java.util.List; +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.achievement.AchievementCategory; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Categories extends Request { + + protected Categories(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on achievement categories API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see AchievementCategory achievement category info + */ + public void getAllAchievementCategoryIDs(Callback> callback) throws NullPointerException { + gw2API.getAllAchievementCategoryIDs().enqueue(callback); + } + + /** + * For more info on achievements categories API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of achievement category id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see AchievementCategory achievement category info + */ + public void getAchievementCategoryInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getAchievementCategoryInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/daily/Daily.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/daily/Daily.java new file mode 100644 index 0000000..6779252 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/daily/Daily.java @@ -0,0 +1,44 @@ +package me.xhsun.guildwars2wrapper.requests.v2.achievements.daily; + +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.achievement.DailyAchievement; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Daily extends Request { + + protected Daily(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on achievements daily API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see DailyAchievement daily achievement info + */ + public void getCurrentDailyAchievements(Callback callback) throws NullPointerException { + gw2API.getCurrentDailyAchievements().enqueue(callback); + } + + /** + * For more info on next achievements daily API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see DailyAchievement daily achievement info + */ + public void getNextDailyAchievements(Callback callback) throws GuildWars2Exception, NullPointerException { + gw2API.getNextDailyAchievements().enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/groups/Groups.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/groups/Groups.java new file mode 100644 index 0000000..e57e276 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/groups/Groups.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.achievements.groups; + +import java.util.List; +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.achievement.AchievementGroup; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Groups extends Request { + + protected Groups(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on achievements groups API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see AchievementGroup achievement group info + */ + public void getAllAchievementGroupID(Callback> callback) throws NullPointerException { + gw2API.getAllAchievementGroupIDs().enqueue(callback); + } + + /** + * For more info on achievements groups API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of achievement group id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see AchievementGroup achievement group info + */ + public void getAchievementGroupInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getAchievementGroupInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/backstory/Answers.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/backstory/Answers.java new file mode 100644 index 0000000..2514617 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/backstory/Answers.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.backstory; + +import java.util.List; +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.backstory.BackStoryAnswer; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Answers extends Request { + + protected Answers(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on back story answer API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see BackStoryAnswer back story answer info + */ + public void getAllBackStoryAnswerID(Callback> callback) throws NullPointerException { + gw2API.getAllBackStoryAnswerIDs().enqueue(callback); + } + + /** + * For more info on back story answer API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of back story answer id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see BackStoryAnswer back story answer info + */ + public void getBackStoryAnswerInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getBackStoryAnswerInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/backstory/Questions.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/backstory/Questions.java new file mode 100644 index 0000000..9f7c0d4 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/backstory/Questions.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.backstory; + +import java.util.List; +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.backstory.BackStoryQuestion; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Questions extends Request { + + protected Questions(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on back story questions API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see BackStoryQuestion back story question info + */ + public void getAllBackStoryQuestionID(Callback> callback) throws NullPointerException { + gw2API.getAllBackStoryQuestionIDs().enqueue(callback); + } + + /** + * For more info on back story questions API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of back story question id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see BackStoryQuestion back story question info + */ + public void getBackStoryQuestionInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getBackStoryQuestionInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //ASYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/build/Build.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/build/Build.java new file mode 100644 index 0000000..f7d78dc --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/build/Build.java @@ -0,0 +1,30 @@ +package me.xhsun.guildwars2wrapper.requests.v2.build; + +import me.xhsun.guildwars2wrapper.model.v2.GameBuild; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Build extends Request { + + protected Build(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on build API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see GameBuild game build info + */ + public void getCurrentGameBuild(Callback callback) throws NullPointerException { + gw2API.getCurrentGameBuild().enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/cats/Cats.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/cats/Cats.java new file mode 100644 index 0000000..51c17d1 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/cats/Cats.java @@ -0,0 +1,47 @@ +package me.xhsun.guildwars2wrapper.requests.v2.cats; + +import java.util.List; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Cat; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Cats extends Request { + + protected Cats(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on cats API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Cat cat info + */ + public void getAllCatID(Callback> callback) throws NullPointerException { + gw2API.getAllCatIDs().enqueue(callback); + } + + /** + * For more info on cats API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of cat id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Cat cat info + */ + public void getCatInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getCatInfo(processIds(ids)).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/characters/Characters.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/characters/Characters.java new file mode 100644 index 0000000..6bc250f --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/characters/Characters.java @@ -0,0 +1,247 @@ +package me.xhsun.guildwars2wrapper.requests.v2.characters; + +import java.util.List; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Recipe; +import me.xhsun.guildwars2wrapper.model.v2.character.Character; +import me.xhsun.guildwars2wrapper.model.v2.character.CharacterBackStory; +import me.xhsun.guildwars2wrapper.model.v2.character.CharacterCore; +import me.xhsun.guildwars2wrapper.model.v2.character.CharacterCraftingLevel; +import me.xhsun.guildwars2wrapper.model.v2.character.CharacterEquipment; +import me.xhsun.guildwars2wrapper.model.v2.character.CharacterInventory; +import me.xhsun.guildwars2wrapper.model.v2.character.CharacterRecipes; +import me.xhsun.guildwars2wrapper.model.v2.character.CharacterSAB; +import me.xhsun.guildwars2wrapper.model.v2.character.CharacterSkills; +import me.xhsun.guildwars2wrapper.model.v2.character.CharacterSpecialization; +import me.xhsun.guildwars2wrapper.model.v2.character.CharacterTraining; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Characters extends Request { + + protected Characters(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Character API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getAllCharacterName(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getAllCharacterName(API).enqueue(callback); + } + + /** + * For more info on character overview API go here
+ * Get character information for the given character name that is linked to given API key + * + * @param API API key + * @param name name of character + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key | empty character name + * @throws NullPointerException if given {@link Callback} is empty + * @see Character character info + */ + public void getCharacter(String API, String name, Callback callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name)); + gw2API.getCharacter(name, API).enqueue(callback); + } + + /** + * For more info on character overview API go here
+ * Get all characters that is linked to given API key + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key | empty character name + * @throws NullPointerException if given {@link Callback} is empty + * @see Character character info + */ + public void getAllCharacters(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getAllCharacters(API).enqueue(callback); + } + + /** + * For more info on character back story API go here
+ * + * @param API API key + * @param name name of character + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key | empty character name + * @throws NullPointerException if given {@link Callback} is empty + * @see CharacterBackStory back store answer info + */ + public void getCharacterBackStory(String API, String name, Callback callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name)); + gw2API.getCharacterBackStory(name, API).enqueue(callback); + } + + /** + * For more info on Character Core API go here
+ * Get basic character information for the given character name that is linked to given API key + * + * @param API API key + * @param name name of character + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key | empty character name + * @throws NullPointerException if given {@link Callback} is empty + * @see CharacterCore basic character info + */ + public void getCharacterInformation(String API, String name, Callback callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name)); + gw2API.getCharacterCore(name, API).enqueue(callback); + } + + /** + * For more info on character crafting API go here
+ * + * @param API API key + * @param name name of character + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key | empty character name + * @throws NullPointerException if given {@link Callback} is empty + * @see CharacterCraftingLevel character crafting info + */ + public void getCharacterCrafting(String API, String name, Callback callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name)); + gw2API.getCharacterCrafting(name, API).enqueue(callback); + } + + /** + * For more info on character equipment API go here
+ * + * @param API API key + * @param name name of character + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key | empty character name + * @throws NullPointerException if given {@link Callback} is empty + * @see CharacterEquipment equipment info + */ + public void getCharacterEquipment(String API, String name, Callback callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name)); + gw2API.getCharacterEquipment(name, API).enqueue(callback); + } + + /** + * For more info on character hero points API go here
+ * + * @param API API key + * @param name name of character + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key | empty character name + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getCharacterHeroPoints(String API, String name, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name)); + gw2API.getCharacterHeroPoints(name, API).enqueue(callback); + } + + /** + * For more info on Character Inventory API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param name character name + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key | empty character name + * @throws NullPointerException if given {@link Callback} is empty + * @see CharacterInventory character inventory info + */ + public void getCharacterInventory(String API, String name, Callback callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name)); + gw2API.getCharacterInventory(name, API).enqueue(callback); + } + + /** + * For more info on Character Recipes API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param name character name + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key | empty character name + * @throws NullPointerException if given {@link Callback} is empty + * @see Recipe recipe info + */ + public void getCharacterUnlockedRecipes(String API, String name, Callback callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name)); + gw2API.getCharacterUnlockedRecipes(name, API).enqueue(callback); + } + + /** + * For more info on Character SAB API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param name character name + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key | empty character name + * @throws NullPointerException if given {@link Callback} is empty + * @see CharacterSAB character SAB info + */ + public void getCharacterSAB(String API, String name, Callback callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name)); + gw2API.getCharacterSAB(name, API).enqueue(callback); + } + + /** + * For more info on Character Skills API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param name character name + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key | empty character name + * @throws NullPointerException if given {@link Callback} is empty + * @see CharacterSkills character skills info + */ + public void getCharacterSkills(String API, String name, Callback callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name)); + gw2API.getCharacterSkills(name, API).enqueue(callback); + } + + /** + * For more info on Character Specialization API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param name character name + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key | empty character name + * @throws NullPointerException if given {@link Callback} is empty + * @see CharacterSpecialization character specialization info + */ + public void getCharacterSpecialization(String API, String name, Callback callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name)); + gw2API.getCharacterSpecialization(name, API).enqueue(callback); + } + + /** + * For more info on Character Training API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param name character name + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key | empty character name + * @throws NullPointerException if given {@link Callback} is empty + * @see CharacterTraining character training info + */ + public void getCharacterTraining(String API, String name, Callback callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name)); + gw2API.getCharacterTraining(name, API).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/colors/Colors.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/colors/Colors.java new file mode 100644 index 0000000..72fad7b --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/colors/Colors.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.colors; + +import java.util.List; +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Color; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Colors extends Request { + + protected Colors(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Color API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Color color info + */ + public void getAllColorID(Callback> callback) throws NullPointerException { + gw2API.getAllColorIDs().enqueue(callback); + } + + /** + * For more info on Color API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of color id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Color color info + */ + public void getColorInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getColorInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/Prices.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/Prices.java new file mode 100644 index 0000000..02a555c --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/Prices.java @@ -0,0 +1,61 @@ +package me.xhsun.guildwars2wrapper.requests.v2.commerce; + +import java.util.List; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.commerce.Listing; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Prices extends Request { + + protected Prices(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Listing Price API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of item id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Listing listing item price info + */ + public void getTPListingInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getTPListingInfo(processIds(ids)).enqueue(callback); + } + + /** + * For more info on Listing Price API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getAllPriceID(Callback> callback) throws NullPointerException { + gw2API.getAllTPPriceIDs().enqueue(callback); + } + + /** + * For more info on Listing Price API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of item id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see me.xhsun.guildwars2wrapper.model.v2.commerce.Prices listing item price info + */ + public void getPriceInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getTPPriceInfo(processIds(ids)).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/Transactions.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/Transactions.java new file mode 100644 index 0000000..cad4e2c --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/Transactions.java @@ -0,0 +1,40 @@ +package me.xhsun.guildwars2wrapper.requests.v2.commerce; + +import java.util.List; +import me.xhsun.guildwars2wrapper.error.ErrorCode; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.commerce.Transaction; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Transactions extends Request { + + protected Transactions(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on transactions API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param time current | History + * @param type buy | sell + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see Transaction transaction info + */ + public void getTPTransaction(String API, Transaction.Time time, Transaction.Type type, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + if (time == null || type == null) + throw new GuildWars2Exception(ErrorCode.TransTime, "Transaction time/type cannot be empty"); + gw2API.getTPTransaction(time.getValue(), type.getValue(), API).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/delivery/Delivery.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/delivery/Delivery.java new file mode 100644 index 0000000..68a3c76 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/delivery/Delivery.java @@ -0,0 +1,33 @@ +package me.xhsun.guildwars2wrapper.requests.v2.commerce.delivery; + +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Delivery extends Request { + + protected Delivery(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on delivery API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see me.xhsun.guildwars2wrapper.model.v2.commerce.Delivery devlivery info + */ + public void getTPDeliveryInfo(String API, Callback callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getTPDeliveryInfo(API).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/exchange/Coins.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/exchange/Coins.java new file mode 100644 index 0000000..de64bb8 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/exchange/Coins.java @@ -0,0 +1,35 @@ +package me.xhsun.guildwars2wrapper.requests.v2.commerce.exchange; + +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.commerce.Exchange; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Coins extends Request { + + protected Coins(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on exchange coins API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param currency exchange currency type + * @param quantity The amount to exchange + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid value + * @throws NullPointerException if given {@link Callback} is empty + * @see me.xhsun.guildwars2wrapper.model.v2.commerce.Exchange Exchange info + */ + public void getExchangeInfo(me.xhsun.guildwars2wrapper.model.v2.commerce.Exchange.Type currency, long quantity, Callback callback) throws GuildWars2Exception, NullPointerException { + isValueValid(quantity); + gw2API.getExchangeInfo(currency.name(), Long.toString(quantity)).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/exchange/Exchange.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/exchange/Exchange.java new file mode 100644 index 0000000..d674d1d --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/exchange/Exchange.java @@ -0,0 +1,29 @@ +package me.xhsun.guildwars2wrapper.requests.v2.commerce.exchange; + +import java.util.List; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Exchange extends Request { + + protected Exchange(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on exchange API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getAllExchangeCurrency(Callback> callback) throws NullPointerException { + gw2API.getAllExchangeCurrency().enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/continents/Continents.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/continents/Continents.java new file mode 100644 index 0000000..8f771bb --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/continents/Continents.java @@ -0,0 +1,249 @@ +package me.xhsun.guildwars2wrapper.requests.v2.continents; + +import java.util.List; +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.continent.Continent; +import me.xhsun.guildwars2wrapper.model.v2.continent.ContinentFloor; +import me.xhsun.guildwars2wrapper.model.v2.continent.ContinentMap; +import me.xhsun.guildwars2wrapper.model.v2.continent.ContinentRegion; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Continents extends Request { + + protected Continents(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on continents API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Continent continents info + */ + public void getAllContinentID(Callback> callback) throws NullPointerException { + gw2API.getAllContinentIDs().enqueue(callback); + } + + /** + * For more info on continents API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of continents id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Continent continents info + */ + public void getContinentInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getContinentInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + /** + * For more info on continents API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param continentID {@link Continent#id} + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see ContinentFloor continents floor info + */ + public void getAllContinentFloorID(int continentID, Callback> callback) throws NullPointerException { + gw2API.getAllContinentFloorIDs(Integer.toString(continentID)).enqueue(callback); + } + + /** + * For more info on continents API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param continentID {@link Continent#id} + * @param ids list of floor id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see ContinentFloor continents floor info + */ + public void getContinentFloorInfo(int continentID, int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getContinentFloorInfo(Integer.toString(continentID), processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + /** + * For more info on continents API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param continentID {@link Continent#id} + * @param floorID {@link ContinentFloor#id} + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see ContinentRegion continents region info + */ + public void getAllContinentRegionID(int continentID, int floorID, Callback> callback) throws NullPointerException { + gw2API.getAllContinentRegionIDs(Integer.toString(continentID), Integer.toString(floorID)).enqueue(callback); + } + + /** + * For more info on continents API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param continentID {@link Continent#id} + * @param floorID {@link ContinentFloor#id} + * @param ids list of region id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see ContinentRegion continents region info + */ + public void getContinentRegionInfo(int continentID, int floorID, int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getContinentRegionInfo(Integer.toString(continentID), Integer.toString(floorID), processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + /** + * For more info on continents API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param continentID {@link Continent#id} + * @param floorID {@link ContinentFloor#id} + * @param regionID {@link ContinentRegion#id} + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see ContinentMap continents map info + */ + public void getAllContinentMapID(int continentID, int floorID, int regionID, Callback> callback) throws NullPointerException { + gw2API.getAllContinentMapIDs(Integer.toString(continentID), Integer.toString(floorID), Integer.toString(regionID)).enqueue(callback); + } + + /** + * For more info on continents API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param continentID {@link Continent#id} + * @param floorID {@link ContinentFloor#id} + * @param regionID {@link ContinentRegion#id} + * @param ids list of region map id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see ContinentMap continents map info + */ + public void getContinentMapInfo(int continentID, int floorID, int regionID, int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getContinentMapInfo(Integer.toString(continentID), Integer.toString(floorID), Integer.toString(regionID), processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + /** + * For more info on continents API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param continentID {@link Continent#id} + * @param floorID {@link ContinentFloor#id} + * @param regionID {@link ContinentRegion#id} + * @param mapID {@link ContinentMap#id} + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see ContinentMap.Sector continents map sector info + */ + public void getAllContinentSectorID(int continentID, int floorID, int regionID, int mapID, Callback> callback) throws NullPointerException { + gw2API.getAllContinentSectorIDs(Integer.toString(continentID), Integer.toString(floorID), Integer.toString(regionID), Integer.toString(mapID)).enqueue(callback); + } + + /** + * For more info on continents API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param continentID {@link Continent#id} + * @param floorID {@link ContinentFloor#id} + * @param regionID {@link ContinentRegion#id} + * @param mapID {@link ContinentMap#id} + * @param ids list of region map sector id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see ContinentMap.Sector continents map sector info + */ + public void getContinentSectorInfo(int continentID, int floorID, int regionID, int mapID, int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getContinentSectorInfo(Integer.toString(continentID), Integer.toString(floorID), Integer.toString(regionID), Integer.toString(mapID), processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + /** + * For more info on continents API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param continentID {@link Continent#id} + * @param floorID {@link ContinentFloor#id} + * @param regionID {@link ContinentRegion#id} + * @param mapID {@link ContinentMap#id} + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see ContinentMap.PoI continents map PoI info + */ + public void getAllContinentPOIID(int continentID, int floorID, int regionID, int mapID, Callback> callback) throws NullPointerException { + gw2API.getAllContinentPOIIDs(Integer.toString(continentID), Integer.toString(floorID), Integer.toString(regionID), Integer.toString(mapID)).enqueue(callback); + } + + /** + * For more info on continents API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param continentID {@link Continent#id} + * @param floorID {@link ContinentFloor#id} + * @param regionID {@link ContinentRegion#id} + * @param mapID {@link ContinentMap#id} + * @param ids list of region map PoI id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see ContinentMap.PoI continents map PoI info + */ + public void getContinentPOIInfo(int continentID, int floorID, int regionID, int mapID, int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getContinentPOIInfo(Integer.toString(continentID), Integer.toString(floorID), Integer.toString(regionID), Integer.toString(mapID), processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + /** + * For more info on continents API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param continentID {@link Continent#id} + * @param floorID {@link ContinentFloor#id} + * @param regionID {@link ContinentRegion#id} + * @param mapID {@link ContinentMap#id} + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see ContinentMap.Task continents map task info + */ + public void getAllContinentTaskID(int continentID, int floorID, int regionID, int mapID, Callback> callback) throws NullPointerException { + gw2API.getAllContinentTaskIDs(Integer.toString(continentID), Integer.toString(floorID), Integer.toString(regionID), Integer.toString(mapID)).enqueue(callback); + } + + /** + * For more info on continents API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param continentID {@link Continent#id} + * @param floorID {@link ContinentFloor#id} + * @param regionID {@link ContinentRegion#id} + * @param mapID {@link ContinentMap#id} + * @param ids list of region map task id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see ContinentMap.Task continents map task info + */ + public void getContinentTaskInfo(int continentID, int floorID, int regionID, int mapID, int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getContinentTaskInfo(Integer.toString(continentID), Integer.toString(floorID), Integer.toString(regionID), Integer.toString(mapID), processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/currencies/Currencies.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/currencies/Currencies.java new file mode 100644 index 0000000..729fd77 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/currencies/Currencies.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.currencies; + +import java.util.List; +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Currency; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Currencies extends Request { + + protected Currencies(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Currency API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Currency currency info + */ + public void getAllCurrencyID(Callback> callback) throws NullPointerException { + gw2API.getAllCurrencies().enqueue(callback); + } + + /** + * For more info on Currency API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of currency id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Currency currency info + */ + public void getCurrencyInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getCurrencyInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/dungeons/Dungeons.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/dungeons/Dungeons.java new file mode 100644 index 0000000..72595f3 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/dungeons/Dungeons.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.dungeons; + +import java.util.List; +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Dungeon; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Dungeons extends Request { + + protected Dungeons(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Dungeons API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Dungeon dungeon info + */ + public void getAllDungeonName(Callback> callback) throws NullPointerException { + gw2API.getAllDungeonName().enqueue(callback); + } + + /** + * For more info on Dungeons API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of dungeon id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Dungeon dungeon info + */ + public void getDungeonInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getDungeonInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/emblem/Emblem.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/emblem/Emblem.java new file mode 100644 index 0000000..9ef7fde --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/emblem/Emblem.java @@ -0,0 +1,63 @@ +package me.xhsun.guildwars2wrapper.requests.v2.emblem; + +import java.util.List; +import me.xhsun.guildwars2wrapper.error.ErrorCode; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Emblem extends Request { + + protected Emblem(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on emblem API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see me.xhsun.guildwars2wrapper.model.v2.Emblem Emblem info + */ + public void getAllEmblemType(Callback> callback) throws NullPointerException { + gw2API.getAllEmblemType().enqueue(callback); + } + + /** + * For more info on emblem API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param type foregrounds/backgrounds + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see me.xhsun.guildwars2wrapper.model.v2.Emblem Emblem info + */ + public void getAllEmblemIDs(me.xhsun.guildwars2wrapper.model.v2.Emblem.Type type, Callback> callback) throws NullPointerException { + gw2API.getAllEmblemIDs(type.name()).enqueue(callback); + } + + /** + * For more info on emblem API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param type foregrounds/backgrounds + * @param ids list of emblem id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list | exceeds ID list limit (ie, ids.length>200) + * @throws NullPointerException if given {@link Callback} is empty + * @see me.xhsun.guildwars2wrapper.model.v2.Emblem Emblem info + */ + public void getAllEmblemInfo(me.xhsun.guildwars2wrapper.model.v2.Emblem.Type type, int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + if (ids.length > 200) + throw new GuildWars2Exception(ErrorCode.ID, "id list too long; this endpoint is limited to 200 ids at once"); + gw2API.getAllEmblemInfo(type.name(), processIds(ids)).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/files/Files.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/files/Files.java new file mode 100644 index 0000000..a717b7c --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/files/Files.java @@ -0,0 +1,47 @@ +package me.xhsun.guildwars2wrapper.requests.v2.files; + +import java.util.List; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Asset; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Files extends Request { + + protected Files(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on files API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Asset file info + */ + public void getAllFileID(Callback> callback) throws NullPointerException { + gw2API.getAllFileIDs().enqueue(callback); + } + + /** + * For more info on files API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of file id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Asset file info + */ + public void getAllFileInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getAllFileInfo(processIds(ids)).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/finishers/Finishers.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/finishers/Finishers.java new file mode 100644 index 0000000..f1ca7cd --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/finishers/Finishers.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.finishers; + +import java.util.List; +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Finisher; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Finishers extends Request { + + protected Finishers(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Finishers API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Finisher finisher info + */ + public void getAllFinisherID(Callback> callback) throws NullPointerException { + gw2API.getAllFinisherIDs().enqueue(callback); + } + + /** + * For more info on Finishers API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of finisher id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Finisher finisher info + */ + public void getFinisherInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getFinisherInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/gliders/Gliders.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/gliders/Gliders.java new file mode 100644 index 0000000..b91d332 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/gliders/Gliders.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.gliders; + +import java.util.List; +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Glider; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Gliders extends Request { + + protected Gliders(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on gliders API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Glider glider info + */ + public void getAllGliderID(Callback> callback) throws NullPointerException { + gw2API.getAllGliderIDs().enqueue(callback); + } + + /** + * For more info on gliders API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of glider id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Glider glider info + */ + public void getGliderInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getGliderInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From 9ae1ca846f066e9e6ad08733d8c42120d67a5517 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 18:57:55 +0100 Subject: [PATCH 09/46] Guild Api Async --- .gitignore | 2 + .../requests/v2/guild/Guild.java | 48 +++++++++++++++++ .../requests/v2/guild/Permissions.java | 48 +++++++++++++++++ .../requests/v2/guild/Search.java | 35 +++++++++++++ .../requests/v2/guild/Upgrades.java | 48 +++++++++++++++++ .../requests/v2/guild/id/Log.java | 51 +++++++++++++++++++ .../requests/v2/guild/id/Members.java | 35 +++++++++++++ .../requests/v2/guild/id/Teams.java | 35 +++++++++++++ .../requests/v2/guild/id/Treasury.java | 35 +++++++++++++ .../requests/v2/guild/id/Upgrades.java | 33 ++++++++++++ 10 files changed, 370 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Guild.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Permissions.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Search.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Upgrades.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Log.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Members.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Teams.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Treasury.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Upgrades.java diff --git a/.gitignore b/.gitignore index cfc778d..2e335f6 100644 --- a/.gitignore +++ b/.gitignore @@ -159,3 +159,5 @@ dist/ nbdist/ .nb-gradle/ MiniClemgw2wrapper.iml + +gw2wrapper\.iml diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Guild.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Guild.java new file mode 100644 index 0000000..ed53a27 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Guild.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.guild; + +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Guild extends Request { + protected Guild(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + + /** + * For more info on guild API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param id guild id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see me.xhsun.guildwars2wrapper.model.v2.guild.Guild guild info + */ + public void getGeneralGuildInfo(String id, Callback callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.GUILD, id)); + gw2API.getGeneralGuildInfo(id).enqueue(callback); + } + + /** + * For more info on guild API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
+ * Note: if the given account is not a member, sometime endpoint will return general guild info instead of detailed info + * + * @param id guild id + * @param api Guild Wars 2 API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see me.xhsun.guildwars2wrapper.model.v2.guild.Guild guild info + */ + public void getDetailedGuildInfo(String id, String api, Callback callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); + gw2API.getDetailedGuildInfo(id, api).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Permissions.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Permissions.java new file mode 100644 index 0000000..e1e41f5 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Permissions.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.guild; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.guild.GuildPermission; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Permissions extends Request { + protected Permissions(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on guild permissions API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see GuildPermission guild permission info + */ + public void getAllGuildPermissionID(Callback> callback) throws NullPointerException { + gw2API.getAllGuildPermissionIDs().enqueue(callback); + } + + /** + * For more info on guild permissions API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of guild permission id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see GuildPermission guild permission info + */ + public void getGuildPermissionInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getGuildPermissionInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Search.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Search.java new file mode 100644 index 0000000..ecbcdac --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Search.java @@ -0,0 +1,35 @@ +package me.xhsun.guildwars2wrapper.requests.v2.guild; + +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.guild.GuildPermission; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Search extends Request { + protected Search(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on guild Search API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param name guild name + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see GuildPermission guild permission info + */ + public void searchGuildID(String name, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.GUILD, name)); + gw2API.searchGuildID(name).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Upgrades.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Upgrades.java new file mode 100644 index 0000000..68993b7 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Upgrades.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.guild; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.guild.GuildUpgrade; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Upgrades extends Request { + protected Upgrades(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on guild upgrades API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see GuildUpgrade guild upgrade info + */ + public void getGuildUpgradeID(Callback> callback) throws NullPointerException { + gw2API.getAllGuildUpgradeIDs().enqueue(callback); + } + + /** + * For more info on guild upgrades API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of guild upgrade id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see GuildUpgrade guild upgrade info + */ + public void getGuildUpgradeInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getGuildUpgradeInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Log.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Log.java new file mode 100644 index 0000000..72f46e9 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Log.java @@ -0,0 +1,51 @@ +package me.xhsun.guildwars2wrapper.requests.v2.guild.id; + +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.guild.GuildLog; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Log extends Request { + protected Log(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on guild log API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
+ * + * @param id guild id + * @param api Guild leader's Guild Wars 2 API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see GuildLog guild log info + */ + public void getGuildLogInfo(String id, String api, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); + gw2API.getGuildLogInfo(id, api).enqueue(callback); + } + + /** + * For more info on guild log API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
+ * + * @param id guild id + * @param api Guild leader's Guild Wars 2 API key + * @param since log id used to filter log entries + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see GuildLog guild log info + */ + public void getFilteredGuildLogInfo(String id, String api, int since, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); + gw2API.getFilteredGuildLogInfo(id, api, Integer.toString(since)).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Members.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Members.java new file mode 100644 index 0000000..41de3c6 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Members.java @@ -0,0 +1,35 @@ +package me.xhsun.guildwars2wrapper.requests.v2.guild.id; + +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.guild.GuildMember; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Members extends Request { + protected Members(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on guild member API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
+ * + * @param id guild id + * @param api Guild leader's Guild Wars 2 API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see GuildMember guild member info + */ + public void getGuildMemberInfo(String id, String api, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); + gw2API.getGuildMemberInfo(id, api).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Teams.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Teams.java new file mode 100644 index 0000000..03d56c9 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Teams.java @@ -0,0 +1,35 @@ +package me.xhsun.guildwars2wrapper.requests.v2.guild.id; + +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.guild.GuildTeam; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Teams extends Request { + protected Teams(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on guild teams API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
+ * + * @param id guild id + * @param api Guild leader's Guild Wars 2 API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see GuildTeam guild team info + */ + public void getGuildTeamsInfo(String id, String api, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); + gw2API.getGuildTeamsInfo(id, api).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Treasury.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Treasury.java new file mode 100644 index 0000000..bd288ac --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Treasury.java @@ -0,0 +1,35 @@ +package me.xhsun.guildwars2wrapper.requests.v2.guild.id; + +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.guild.GuildTreasury; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Treasury extends Request { + protected Treasury(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on guild treasury API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
+ * + * @param id guild id + * @param api Guild leader's Guild Wars 2 API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see GuildTreasury guild treasury info + */ + public void getGuildTreasuryInfo(String id, String api, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); + gw2API.getGuildTreasuryInfo(id, api).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Upgrades.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Upgrades.java new file mode 100644 index 0000000..f416e01 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Upgrades.java @@ -0,0 +1,33 @@ +package me.xhsun.guildwars2wrapper.requests.v2.guild.id; + +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Upgrades extends Request { + protected Upgrades(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on guild unlocked upgrades API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
+ * + * @param id guild id + * @param api Guild leader's Guild Wars 2 API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getGuildUnlockedUpgradesID(String id, String api, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); + gw2API.getGuildUpgradeIDs(id, api).enqueue(callback); + } + + //SYNC +} From 3fea57ae50d6367817e9a7215249dd2b163fb35f Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:33:37 +0100 Subject: [PATCH 10/46] Typos There are more, but I'll correct them if I encounter more, too much tedious --- .../requests/AsynchronousRequest.java | 10 +++++----- .../requests/v2/account/Achievements.java | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/AsynchronousRequest.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/AsynchronousRequest.java index 638dbad..be81a6a 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/AsynchronousRequest.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/AsynchronousRequest.java @@ -1798,7 +1798,7 @@ public void getMailCarrierInfo(int[] ids, Callback> callback) //Maps /** - * For more info on mail carriers API go here
+ * For more info on map API go here
* Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions * * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} @@ -1810,7 +1810,7 @@ public void getAllMapID(Callback> callback) throws NullPointerExce } /** - * For more info on map API go here
+ * For more info on map API go here
* Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions * * @param ids list of map id @@ -2180,7 +2180,7 @@ public void getPvPSeasonLeaderBoardInfo(String id, String type, World.Region reg //PvP Standings /** - * For more info on pvp season API go here
+ * For more info on pvp season API go here
* Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions * * @param api Guild Wars 2 API key @@ -2730,7 +2730,7 @@ public void getWvWMatchStat(String[] ids, Callback> callback) //WvW Objectives /** - * For more info on WvW abilities API go here
+ * For more info on WvW objectives API go here
* Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions * * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} @@ -2742,7 +2742,7 @@ public void getAllWvWObjectiveID(Callback> callback) throws NullPoi } /** - * For more info on WvW abilities API go here
+ * For more info on WvW objectives API go here
* Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions * * @param ids list of WvW objective id diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Achievements.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Achievements.java index 6d1e1d0..1d45b96 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Achievements.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Achievements.java @@ -19,7 +19,7 @@ protected Achievements(GuildWars2API gw2API) { //ASYNC /** - * For more info on Account API go here
+ * For more info on Account API go here
* Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions * * @param API API key @@ -35,7 +35,7 @@ public void getAchievementProgression(String API, Callbackhere
+ * For more info on Account API go here
* Get an account's progress towards all their achievements. * * @param API API key From 040f6ceb5b0e096cdec8d490fe9dab6b1d936782 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:34:03 +0100 Subject: [PATCH 11/46] Item api Async --- .../requests/v2/items/Items.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/items/Items.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/items/Items.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/items/Items.java new file mode 100644 index 0000000..0886392 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/items/Items.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.items; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Item; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Items extends Request { + protected Items(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Item API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Item item info + */ + public void getAllItemID(Callback> callback) throws NullPointerException { + gw2API.getAllItemIDs().enqueue(callback); + } + + /** + * For more info on Item API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of item id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Item item info + */ + public void getItemInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getItemInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From 78f30b5691d3226891dd28307bf17ef6c6913107 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:34:15 +0100 Subject: [PATCH 12/46] Itemstats api Async --- .../requests/v2/itemstats/ItemsStats.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/itemstats/ItemsStats.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/itemstats/ItemsStats.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/itemstats/ItemsStats.java new file mode 100644 index 0000000..e374a67 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/itemstats/ItemsStats.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.itemstats; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.ItemStats; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class ItemsStats extends Request { + protected ItemsStats(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Itemstat API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see ItemStats itemstat info + */ + public void getAllItemStatID(Callback> callback) throws NullPointerException { + gw2API.getAllItemStatIDs().enqueue(callback); + } + + /** + * For more info on Itemstat API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of itemstat id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see ItemStats itemstat info + */ + public void getItemStatInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getItemStatInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From 0661ee506e5342023809d0e8e46d6ac09b847e25 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:34:29 +0100 Subject: [PATCH 13/46] Legends api Async --- .../requests/v2/legends/Legends.java | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/legends/Legends.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/legends/Legends.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/legends/Legends.java new file mode 100644 index 0000000..a0e704c --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/legends/Legends.java @@ -0,0 +1,47 @@ +package me.xhsun.guildwars2wrapper.requests.v2.legends; + +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Legend; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Legends extends Request { + protected Legends(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on legends API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Legend legend info + */ + public void getAllLegendID(Callback> callback) throws NullPointerException { + gw2API.getAllLegendIDs().enqueue(callback); + } + + /** + * For more info on legends API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of legend id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Legend legend info + */ + public void getLegendInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getLegendInfo(processIds(ids)).enqueue(callback); + } + + //SYNC +} From 3a7b30cf54a5fb50a17fc41a8a3ef1bf8d5f92bc Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:34:41 +0100 Subject: [PATCH 14/46] MailCarriers api Async --- .../v2/mailcarriers/MailCarriers.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/mailcarriers/MailCarriers.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/mailcarriers/MailCarriers.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/mailcarriers/MailCarriers.java new file mode 100644 index 0000000..7ab9d09 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/mailcarriers/MailCarriers.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.mailcarriers; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.MailCarrier; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class MailCarriers extends Request { + protected MailCarriers(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on mail carriers API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see MailCarrier mail carrier info + */ + public void getAllMailCarrierID(Callback> callback) throws NullPointerException { + gw2API.getAllMailCarrierIDs().enqueue(callback); + } + + /** + * For more info on mail carriers API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of mail carrier id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see MailCarrier mail carrier info + */ + public void getMailCarrierInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getMailCarrierInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From 1ee465d47d7c736f6bbebe2261465ba14d48b7a0 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:34:51 +0100 Subject: [PATCH 15/46] Maps api Async --- .../requests/v2/maps/Maps.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/maps/Maps.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/maps/Maps.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/maps/Maps.java new file mode 100644 index 0000000..5c74e2c --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/maps/Maps.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.maps; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.MapOverview; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Maps extends Request { + protected Maps(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on map API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see MapOverview map info + */ + public void getAllMapID(Callback> callback) throws NullPointerException { + gw2API.getAllMapIDs().enqueue(callback); + } + + /** + * For more info on map API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of map id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see MapOverview map info + */ + public void getMapInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getMapInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From b4e4a0b92c30a7ca93c9440be68367d26b880309 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:35:01 +0100 Subject: [PATCH 16/46] Masteries api Async --- .../requests/v2/masteries/Masteries.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/masteries/Masteries.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/masteries/Masteries.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/masteries/Masteries.java new file mode 100644 index 0000000..2b9b7b0 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/masteries/Masteries.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.masteries; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Mastery; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Masteries extends Request { + protected Masteries(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * or more info on masteries API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Mastery mastery info + */ + public void getAllMasteryID(Callback> callback) throws NullPointerException { + gw2API.getAllMasteryIDs().enqueue(callback); + } + + /** + * or more info on masteries API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of mastery id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Mastery mastery info + */ + public void getMasteryInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getMasteryInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From 94e788415f386028a90a0876f448446c9900932d Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:35:09 +0100 Subject: [PATCH 17/46] Materials api Async --- .../requests/v2/materials/Materials.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/materials/Materials.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/materials/Materials.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/materials/Materials.java new file mode 100644 index 0000000..47ae121 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/materials/Materials.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.materials; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.MaterialCategory; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Materials extends Request { + protected Materials(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Material MaterialCategory API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see MaterialCategory material category info + */ + public void getAllMaterialCategoryID(Callback> callback) throws NullPointerException { + gw2API.getAllMaterialBankIDs().enqueue(callback); + } + + /** + * For more info on Material MaterialCategory API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of category id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see MaterialCategory material category info + */ + public void getMaterialCategoryInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getMaterialBankInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From d10fbb8c03cc31716f4d482bfc777f5e45c034d9 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:35:16 +0100 Subject: [PATCH 18/46] Minis api Async --- .../requests/v2/minis/Minis.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/minis/Minis.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/minis/Minis.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/minis/Minis.java new file mode 100644 index 0000000..6d8e08b --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/minis/Minis.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.minis; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Mini; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Minis extends Request { + protected Minis(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Mini API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Mini mini info + */ + public void getAllMiniID(Callback> callback) throws NullPointerException { + gw2API.getAllMiniIDs().enqueue(callback); + } + + /** + * For more info on Mini API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of mini id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Mini mini info + */ + public void getMiniInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getMiniInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From 01422f6abf683f7d15c33450c0cbdce11cac6cc1 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:35:23 +0100 Subject: [PATCH 19/46] Nodes api Async --- .../requests/v2/nodes/Nodes.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/nodes/Nodes.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/nodes/Nodes.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/nodes/Nodes.java new file mode 100644 index 0000000..5c51593 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/nodes/Nodes.java @@ -0,0 +1,29 @@ +package me.xhsun.guildwars2wrapper.requests.v2.nodes; + +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Nodes extends Request { + protected Nodes(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on nodes API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getAllHomeInstanceNodeID(Callback> callback) throws NullPointerException { + gw2API.getAllHomeInstanceNodeIDs().enqueue(callback); + } + + //SYNC +} From de480540a8effce30e6accfc1d907eb681cef927 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:35:31 +0100 Subject: [PATCH 20/46] Outfits api Async --- .../requests/v2/outfits/Outfits.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/outfits/Outfits.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/outfits/Outfits.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/outfits/Outfits.java new file mode 100644 index 0000000..00856a6 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/outfits/Outfits.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.outfits; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Outfit; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Outfits extends Request { + protected Outfits(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Outfits API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Outfit outfit info + */ + public void getAllOutfitID(Callback> callback) throws NullPointerException { + gw2API.getAllOutfitIDs().enqueue(callback); + } + + /** + * For more info on Outfits API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of outfit id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Outfit outfit info + */ + public void getOutfitInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getOutfitInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From aed4586cbaa1507c9eb7d5dbd0fdd6143b90315b Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:35:37 +0100 Subject: [PATCH 21/46] Pets api Async --- .../requests/v2/pets/Pets.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pets/Pets.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pets/Pets.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pets/Pets.java new file mode 100644 index 0000000..9e71cfe --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pets/Pets.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.pets; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Pet; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Pets extends Request { + protected Pets(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on pets API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Pet pet info + */ + public void getAllPetID(Callback> callback) throws NullPointerException { + gw2API.getAllPetIDs().enqueue(callback); + } + + /** + * For more info on pets API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of pet id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Pet pet info + */ + public void getPetInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getPetInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From 85fd6e1b75f1dbcfc979143faeab3a910ddadb3b Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:35:44 +0100 Subject: [PATCH 22/46] Professions api Async --- .../requests/v2/professions/Professions.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/professions/Professions.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/professions/Professions.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/professions/Professions.java new file mode 100644 index 0000000..ffe8429 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/professions/Professions.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.professions; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Profession; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Professions extends Request { + protected Professions(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on professions API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Profession profession info + */ + public void getAllProfessionID(Callback> callback) throws NullPointerException { + gw2API.getAllProfessionIDs().enqueue(callback); + } + + /** + * For more info on professions API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of profession id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Profession profession info + */ + public void getProfessionInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getProfessionInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From 4d64f6dd21094066d83d7f7be1166bcb0bf3bd93 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:36:00 +0100 Subject: [PATCH 23/46] PVP api Async salty --- .../requests/v2/pvp/Amulets.java | 48 +++++++++++++++++ .../requests/v2/pvp/Games.java | 51 +++++++++++++++++++ .../requests/v2/pvp/Heroes.java | 48 +++++++++++++++++ .../requests/v2/pvp/Ranks.java | 48 +++++++++++++++++ .../requests/v2/pvp/Seasons.java | 48 +++++++++++++++++ .../requests/v2/pvp/Standings.java | 36 +++++++++++++ .../requests/v2/pvp/Stats.java | 33 ++++++++++++ .../requests/v2/pvp/id/Leaderboard.java | 35 +++++++++++++ 8 files changed, 347 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Amulets.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Games.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Heroes.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Ranks.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Seasons.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Standings.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Stats.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/id/Leaderboard.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Amulets.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Amulets.java new file mode 100644 index 0000000..afdada0 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Amulets.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.pvp; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.pvp.PvPAmulet; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Amulets extends Request { + protected Amulets(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on pvp amulets API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see PvPAmulet amulet info + */ + public void getAllPvPAmuletID(Callback> callback) throws NullPointerException { + gw2API.getAllPvPAmuletIDs().enqueue(callback); + } + + /** + * For more info on pvp amulets API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of amulet id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see PvPAmulet amulet info + */ + public void getPvPAmuletInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getPvPAmuletInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Games.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Games.java new file mode 100644 index 0000000..32eb784 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Games.java @@ -0,0 +1,51 @@ +package me.xhsun.guildwars2wrapper.requests.v2.pvp; + +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.pvp.PvPGame; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Games extends Request { + protected Games(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on pvp games API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param api Guild Wars 2 API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @throws GuildWars2Exception invalid API key + * @see PvPGame pvp game info + */ + public void getAllPvPGameID(String api, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, api)); + gw2API.getAllPvPGameIDs(api).enqueue(callback); + } + + /** + * For more info on pvp games API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param api Guild Wars 2 API key + * @param ids list of pvp game id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see PvPGame pvp game info + */ + public void getPvPGameInfo(String api, String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, api), new ParamChecker(ids)); + gw2API.getPvPGameInfo(api, processIds(ids)).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Heroes.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Heroes.java new file mode 100644 index 0000000..3b31c28 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Heroes.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.pvp; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.pvp.PvPHero; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Heroes extends Request { + protected Heroes(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on pvp heroes API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see PvPHero pvp hero info + */ + public void getAllPvPHeroID(Callback> callback) throws NullPointerException { + gw2API.getAllPvPHeroIDs().enqueue(callback); + } + + /** + * For more info on pvp heroes API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of pvp hero id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see PvPHero pvp hero info + */ + public void getPvPHeroInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getPvPHeroInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Ranks.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Ranks.java new file mode 100644 index 0000000..40c409c --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Ranks.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.pvp; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.pvp.PvPRank; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Ranks extends Request { + protected Ranks(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on pvp ranks API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see PvPRank PvP rank info + */ + public void getAllPvPRankID(Callback> callback) throws NullPointerException { + gw2API.getAllPvPRankIDs().enqueue(callback); + } + + /** + * For more info on pvp ranks API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of PvP rank id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see PvPRank PvP rank info + */ + public void getPvPRankInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getPvPRankInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Seasons.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Seasons.java new file mode 100644 index 0000000..1aca8df --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Seasons.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.pvp; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.pvp.PvPSeason; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Seasons extends Request { + protected Seasons(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on pvp season API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see PvPSeason pvp season info + */ + public void getAllPvPSeasonID(Callback> callback) throws NullPointerException { + gw2API.getAllPvPSeasonIDs().enqueue(callback); + } + + /** + * For more info on pvp season API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of pvp season id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see PvPSeason pvp season info + */ + public void getPvPSeasonInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getPvPSeasonInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Standings.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Standings.java new file mode 100644 index 0000000..c61360d --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Standings.java @@ -0,0 +1,36 @@ +package me.xhsun.guildwars2wrapper.requests.v2.pvp; + +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.pvp.PvPLeaderBoard; +import me.xhsun.guildwars2wrapper.model.v2.pvp.PvPStanding; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Standings extends Request { + protected Standings(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on pvp season API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param api Guild Wars 2 API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @throws GuildWars2Exception invalid api key + * @see PvPLeaderBoard pvp season info + */ + public void getPvPStandingInfo(String api, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, api)); + gw2API.getPvPStandingInfo(api).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Stats.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Stats.java new file mode 100644 index 0000000..38e336d --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Stats.java @@ -0,0 +1,33 @@ +package me.xhsun.guildwars2wrapper.requests.v2.pvp; + +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.pvp.PvPStat; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +public class Stats extends Request { + protected Stats(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on pvp stat API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param api Guild Wars 2 API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @throws GuildWars2Exception invalid api key + * @see PvPStat pvp stat info + */ + public void getPvPStatInfo(String api, Callback callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, api)); + gw2API.getPvPStatInfo(api).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/id/Leaderboard.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/id/Leaderboard.java new file mode 100644 index 0000000..2aa4ef5 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/id/Leaderboard.java @@ -0,0 +1,35 @@ +package me.xhsun.guildwars2wrapper.requests.v2.pvp.id; + +import me.xhsun.guildwars2wrapper.model.v2.World; +import me.xhsun.guildwars2wrapper.model.v2.pvp.PvPLeaderBoard; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Leaderboard extends Request { + protected Leaderboard(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on pvp season API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param id Season id + * @param type ladder/legendary/guild + * @param region na/eu + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see PvPLeaderBoard pvp season info + */ + public void getPvPSeasonLeaderBoardInfo(String id, String type, World.Region region, Callback> callback) throws NullPointerException { + gw2API.getPvPSeasonLeaderBoardInfo(id, type, region.name().toLowerCase()).enqueue(callback); + } + + //SYNC +} From de435f2bb6db2b2fbdd31d60f63334ba68d9e049 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:36:16 +0100 Subject: [PATCH 24/46] Quaggans api Async --- .../requests/v2/quaggans/Quaggans.java | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/quaggans/Quaggans.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/quaggans/Quaggans.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/quaggans/Quaggans.java new file mode 100644 index 0000000..e7d368f --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/quaggans/Quaggans.java @@ -0,0 +1,45 @@ +package me.xhsun.guildwars2wrapper.requests.v2.quaggans; + +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; +import java.util.Map; + +public class Quaggans extends Request { + protected Quaggans(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on quaggans API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getAllQuagganID(Callback> callback) throws NullPointerException { + gw2API.getAllQuagganIDs().enqueue(callback); + } + + /** + * For more info on quaggans API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of quaggan id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getQuagganInfo(String[] ids, Callback>> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getQuagganInfo(processIds(ids)).enqueue(callback); + } + + //SYNC +} From ab8fd64e1f77b98288c598caba91c7cd8de62279 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:36:24 +0100 Subject: [PATCH 25/46] Races api Async --- .../requests/v2/races/Races.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/races/Races.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/races/Races.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/races/Races.java new file mode 100644 index 0000000..1debcf0 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/races/Races.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.races; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Race; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Races extends Request { + protected Races(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on races API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Race race info + */ + public void getAllRaceID(Callback> callback) throws NullPointerException { + gw2API.getAllRaceIDs().enqueue(callback); + } + + /** + * For more info on races API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of race id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Race race info + */ + public void getRaceInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getRaceInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From 71fafeea636438a93ac43a022aa74303870ac4b7 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:36:30 +0100 Subject: [PATCH 26/46] Raids api Async --- .../requests/v2/raids/Raids.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/raids/Raids.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/raids/Raids.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/raids/Raids.java new file mode 100644 index 0000000..cc3b94c --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/raids/Raids.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.raids; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Raid; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Raids extends Request { + protected Raids(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on raids API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Raid raid info + */ + public void getAllRaidID(Callback> callback) throws NullPointerException { + gw2API.getAllRaidIDs().enqueue(callback); + } + + /** + * For more info on raids API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of raid id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Raid raid info + */ + public void getRaidInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getRaidInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From 3ca4b8d31f012849ab3d7fcfa459fee2f9fe959e Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:36:36 +0100 Subject: [PATCH 27/46] Recipes api Async --- .../requests/v2/recipes/Recipes.java | 47 +++++++++++++++++++ .../requests/v2/recipes/search/Search.java | 32 +++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/recipes/Recipes.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/recipes/search/Search.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/recipes/Recipes.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/recipes/Recipes.java new file mode 100644 index 0000000..8f59f43 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/recipes/Recipes.java @@ -0,0 +1,47 @@ +package me.xhsun.guildwars2wrapper.requests.v2.recipes; + +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Recipe; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Recipes extends Request { + protected Recipes(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Recipes API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Recipe recipe info + */ + public void getAllRecipeID(Callback> callback) throws NullPointerException { + gw2API.getAllRecipeIDs().enqueue(callback); + } + + /** + * For more info on Recipes API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of recipe id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Recipe recipe info + */ + public void getRecipeInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getRecipeInfo(processIds(ids)).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/recipes/search/Search.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/recipes/search/Search.java new file mode 100644 index 0000000..51b90f2 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/recipes/search/Search.java @@ -0,0 +1,32 @@ +package me.xhsun.guildwars2wrapper.requests.v2.recipes.search; + +import me.xhsun.guildwars2wrapper.model.v2.Recipe; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Search extends Request { + protected Search(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Recipes search API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Recipe recipe info + */ + public void searchRecipes(boolean isInput, int id, Callback> callback) throws NullPointerException { + if (isInput) gw2API.searchInputRecipes(Integer.toString(id)).enqueue(callback); + else gw2API.searchOutputRecipes(Integer.toString(id)).enqueue(callback); + } + + //SYNC +} From 4f156c08ac378605a672210f228d96a16b872354 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:36:46 +0100 Subject: [PATCH 28/46] Skills api Async Got no one --- .../requests/v2/skills/Skills.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/skills/Skills.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/skills/Skills.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/skills/Skills.java new file mode 100644 index 0000000..40c01bb --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/skills/Skills.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.skills; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Skill; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Skills extends Request { + protected Skills(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Skills API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Skill skill info + */ + public void getAllSkillID(Callback> callback) throws NullPointerException { + gw2API.getAllSkillIDs().enqueue(callback); + } + + /** + * For more info on Skills API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of skill id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Skill skill info + */ + public void getSkillInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getSkillInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From 5e1d09d7fe42646396a0940adbb9c8531afb9ec3 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:37:00 +0100 Subject: [PATCH 29/46] Skins api Async fashion wars 2 --- .../requests/v2/skins/Skins.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/skins/Skins.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/skins/Skins.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/skins/Skins.java new file mode 100644 index 0000000..fce2df2 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/skins/Skins.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.skins; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Skin; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Skins extends Request { + protected Skins(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Skin API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Skin skin info + */ + public void getAllSkinID(Callback> callback) throws NullPointerException { + gw2API.getAllSkinIDs().enqueue(callback); + } + + /** + * For more info on Skin API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of skin id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Skin skin info + */ + public void getSkinInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getSkinInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From b66b55e11db181940929ab6dcaebc6570f7c562e Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:37:10 +0100 Subject: [PATCH 30/46] Specialization api Async --- .../v2/specialization/Specializations.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/specialization/Specializations.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/specialization/Specializations.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/specialization/Specializations.java new file mode 100644 index 0000000..63b5542 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/specialization/Specializations.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.specialization; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Specialization; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Specializations extends Request { + protected Specializations(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on specializations API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Specialization specialization info + */ + public void getAllSpecializationID(Callback> callback) throws NullPointerException { + gw2API.getAllSpecializationIDs().enqueue(callback); + } + + /** + * For more info on specializations API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of specialization id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Specialization specialization info + */ + public void getSpecializationInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getSpecializationInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From ca97d76c8827c9b9ced4f856b3b81ff27b2abe74 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:37:18 +0100 Subject: [PATCH 31/46] Stories api Async --- .../requests/v2/stories/Stories.java | 48 +++++++++++++++++++ .../requests/v2/stories/seasons/Seasons.java | 48 +++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/stories/Stories.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/stories/seasons/Seasons.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/stories/Stories.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/stories/Stories.java new file mode 100644 index 0000000..9d12cba --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/stories/Stories.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.stories; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.story.Story; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Stories extends Request { + protected Stories(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on stories API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Story story info + */ + public void getAllStoryID(Callback> callback) throws NullPointerException { + gw2API.getAllStoryIDs().enqueue(callback); + } + + /** + * For more info on stories API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of story id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Story story info + */ + public void getStoryInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getStoryInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/stories/seasons/Seasons.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/stories/seasons/Seasons.java new file mode 100644 index 0000000..4414c47 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/stories/seasons/Seasons.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.stories.seasons; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.story.StorySeason; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Seasons extends Request { + protected Seasons(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on stories seasons API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see StorySeason story season info + */ + public void getAllStorySeasonID(Callback> callback) throws NullPointerException { + gw2API.getAllStorySeasonIDs().enqueue(callback); + } + + /** + * For more info on stories seasons API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of story season id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see StorySeason story season info + */ + public void getStorySeasonInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getStorySeasonInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From 8b8896b9b5cb23b581e091ce765db3498a1bcd14 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:37:25 +0100 Subject: [PATCH 32/46] Titles api Async --- .../requests/v2/titles/Titles.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/titles/Titles.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/titles/Titles.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/titles/Titles.java new file mode 100644 index 0000000..a854a9a --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/titles/Titles.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.titles; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Title; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Titles extends Request { + protected Titles(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on titles API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Title title info + */ + public void getAllTitleID(Callback> callback) throws NullPointerException { + gw2API.getAllTitleIDs().enqueue(callback); + } + + /** + * For more info on titles API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of title id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Title title info + */ + public void getTitleInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getTitleInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From 8368c176b73582ea371d1825deb667bc7b0ca8c9 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:37:32 +0100 Subject: [PATCH 33/46] Traits api Async --- .../requests/v2/traits/Traits.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/traits/Traits.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/traits/Traits.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/traits/Traits.java new file mode 100644 index 0000000..4279d9d --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/traits/Traits.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.traits; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Trait; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Traits extends Request { + protected Traits(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on traits API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Trait trait info + */ + public void getAllTraitID(Callback> callback) throws NullPointerException { + gw2API.getAllTraitIDs().enqueue(callback); + } + + /** + * For more info on traits API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of trait id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Trait trait info + */ + public void getTraitInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getTraitInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From e1e5ce6cb7e73bb49446e0290bac4c5afbf56f05 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:37:40 +0100 Subject: [PATCH 34/46] Worlds api Async --- .../requests/v2/worlds/Worlds.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/worlds/Worlds.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/worlds/Worlds.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/worlds/Worlds.java new file mode 100644 index 0000000..45397c5 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/worlds/Worlds.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.worlds; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.World; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Worlds extends Request { + protected Worlds(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on World API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see World world info + */ + public void getAllWorldID(Callback> callback) throws NullPointerException { + gw2API.getAllWorldsIDs().enqueue(callback); + } + + /** + * For more info on World API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of world id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see World world info + */ + public void getWorldInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getWorldsInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From d8de172cfb23d5037ee091858ad96cb9c7db6ec2 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Feb 2019 19:37:50 +0100 Subject: [PATCH 35/46] WvW api Async --- .../requests/v2/wvw/Wvw.java | 4 + .../requests/v2/wvw/abilities/Abilities.java | 48 ++++++ .../requests/v2/wvw/matches/Matches.java | 149 ++++++++++++++++++ .../v2/wvw/objectives/Objectives.java | 48 ++++++ .../requests/v2/wvw/ranks/Ranks.java | 48 ++++++ .../requests/v2/wvw/upgrades/Upgrades.java | 48 ++++++ 6 files changed, 345 insertions(+) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/Wvw.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/abilities/Abilities.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/matches/Matches.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/objectives/Objectives.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/ranks/Ranks.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/upgrades/Upgrades.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/Wvw.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/Wvw.java new file mode 100644 index 0000000..ce60c10 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/Wvw.java @@ -0,0 +1,4 @@ +package me.xhsun.guildwars2wrapper.requests.v2.wvw; + +public class Wvw { +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/abilities/Abilities.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/abilities/Abilities.java new file mode 100644 index 0000000..85e1d90 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/abilities/Abilities.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.wvw.abilities; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.wvw.WvWAbility; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Abilities extends Request { + protected Abilities(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on WvW abilities API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWAbility WvW abilities info + */ + public void getAllWvWAbilityID(Callback> callback) throws NullPointerException { + gw2API.getAllWvWAbilityIDs().enqueue(callback); + } + + /** + * For more info on WvW abilities API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of WvW abilities id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWAbility WvW abilities info + */ + public void getWvWAbilityInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getWvWAbilityInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/matches/Matches.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/matches/Matches.java new file mode 100644 index 0000000..85ed3aa --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/matches/Matches.java @@ -0,0 +1,149 @@ +package me.xhsun.guildwars2wrapper.requests.v2.wvw.matches; + +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.World; +import me.xhsun.guildwars2wrapper.model.v2.wvw.WvWAbility; +import me.xhsun.guildwars2wrapper.model.v2.wvw.matches.WvWMatchDetail; +import me.xhsun.guildwars2wrapper.model.v2.wvw.matches.WvWMatchOverview; +import me.xhsun.guildwars2wrapper.model.v2.wvw.matches.WvWMatchScore; +import me.xhsun.guildwars2wrapper.model.v2.wvw.matches.WvWMatchStat; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Matches extends Request { + protected Matches(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on WvW matches API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWAbility WvW match info + */ + public void getAllWvWMatchID(Callback> callback) throws NullPointerException { + gw2API.getAllWvWMatchIDs().enqueue(callback); + } + + /** + * For more info on WvW matches API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param worldID {@link World#id} + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWMatchDetail WvW match detailed info + */ + public void getWvWMatchDetail(int worldID, Callback callback) throws NullPointerException { + gw2API.getWvWMatchInfoUsingWorld(Integer.toString(worldID)).enqueue(callback); + } + + /** + * For more info on WvW matches API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of wvw match id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @throws GuildWars2Exception empty ID list + * @see WvWMatchDetail WvW match detailed info + */ + public void getWvWMatchDetail(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getWvWMatchInfoUsingID(processIds(ids)).enqueue(callback); + } + + /** + * For more info on WvW matches API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param worldID {@link World#id} + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWMatchOverview WvW match overview info + */ + public void getWvWMatchOverview(int worldID, Callback callback) throws NullPointerException { + gw2API.getWvWMatchOverviewUsingWorld(Integer.toString(worldID)).enqueue(callback); + } + + /** + * For more info on WvW matches API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of wvw match id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @throws GuildWars2Exception empty ID list + * @see WvWMatchOverview WvW match overview info + */ + public void getWvWMatchOverview(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getWvWMatchOverviewUsingID(processIds(ids)).enqueue(callback); + } + + /** + * For more info on WvW matches API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param worldID {@link World#id} + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWMatchScore WvW match score info + */ + public void getWvWMatchScore(int worldID, Callback callback) throws NullPointerException { + gw2API.getWvWMatchScoreUsingWorld(Integer.toString(worldID)).enqueue(callback); + } + + /** + * For more info on WvW matches API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of wvw match id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @throws GuildWars2Exception empty ID list + * @see WvWMatchScore WvW match score info + */ + public void getWvWMatchScore(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getWvWMatchScoreUsingID(processIds(ids)).enqueue(callback); + } + + /** + * For more info on WvW matches API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param worldID {@link World#id} + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWMatchStat WvW match stat info + */ + public void getWvWMatchStat(int worldID, Callback callback) throws NullPointerException { + gw2API.getWvWMatchStatUsingWorld(Integer.toString(worldID)).enqueue(callback); + } + + /** + * For more info on WvW matches API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of wvw match id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @throws GuildWars2Exception empty ID list + * @see WvWMatchStat WvW match stat info + */ + public void getWvWMatchStat(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getWvWMatchStatUsingID(processIds(ids)).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/objectives/Objectives.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/objectives/Objectives.java new file mode 100644 index 0000000..f64deb2 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/objectives/Objectives.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.wvw.objectives; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.wvw.WvWObjective; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Objectives extends Request { + protected Objectives(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on WvW objectives API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWObjective WvW objective info + */ + public void getAllWvWObjectiveID(Callback> callback) throws NullPointerException { + gw2API.getAllWvWObjectiveIDs().enqueue(callback); + } + + /** + * For more info on WvW objectives API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of WvW objective id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWObjective WvW objective info + */ + public void getWvWObjectiveInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getWvWObjectiveInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/ranks/Ranks.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/ranks/Ranks.java new file mode 100644 index 0000000..7f67a55 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/ranks/Ranks.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.wvw.ranks; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.wvw.WvWRank; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Ranks extends Request { + protected Ranks(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on WvW ranks API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWRank WvW rank info + */ + public void getAllWvWRankID(Callback> callback) throws NullPointerException { + gw2API.getAllWvWRankIDs().enqueue(callback); + } + + /** + * For more info on WvW ranks API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of WvW rank id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWRank WvW rank info + */ + public void getWvWRankInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getWvWRankInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/upgrades/Upgrades.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/upgrades/Upgrades.java new file mode 100644 index 0000000..5bff9cc --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/upgrades/Upgrades.java @@ -0,0 +1,48 @@ +package me.xhsun.guildwars2wrapper.requests.v2.wvw.upgrades; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.wvw.WvWUpgrade; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Upgrades extends Request { + protected Upgrades(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on WvW upgrades API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWUpgrade WvW upgrade info + */ + public void getAllWvWUpgradeID(Callback> callback) throws NullPointerException { + gw2API.getAllWvWUpgradeIDs().enqueue(callback); + } + + /** + * For more info on WvW upgrades API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of WvW upgrade id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWUpgrade WvW upgrade info + */ + public void getWvWUpgradeInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getWvWUpgradeInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //SYNC +} From 50698ec413cd4f1d7905b47ba15dc57c19e8900d Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 2 Mar 2019 13:27:08 +0100 Subject: [PATCH 36/46] Gw2 Account v2 async new organization start --- .../requests/v2/account/Account.java | 362 ++++++++++++++++++ .../requests/v2/account/Achievements.java | 57 --- .../requests/v2/account/Bank.java | 56 --- .../requests/v2/account/Dungeons.java | 52 --- .../requests/v2/account/Dyes.java | 56 --- .../requests/v2/account/Finishers.java | 56 --- .../requests/v2/account/Gliders.java | 31 -- .../requests/v2/account/Inventory.java | 34 -- .../requests/v2/account/Mailcarriers.java | 33 -- .../requests/v2/account/Masteries.java | 35 -- .../requests/v2/account/Materials.java | 35 -- .../requests/v2/account/Minis.java | 35 -- .../requests/v2/account/Outfits.java | 33 -- .../requests/v2/account/Raids.java | 33 -- .../requests/v2/account/Recipes.java | 35 -- .../requests/v2/account/Skins.java | 35 -- .../requests/v2/account/Titles.java | 33 -- .../requests/v2/account/Wallet.java | 34 -- 18 files changed, 362 insertions(+), 683 deletions(-) delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Achievements.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Bank.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dungeons.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dyes.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Finishers.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Gliders.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Inventory.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Mailcarriers.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Masteries.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Materials.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Minis.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Outfits.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Raids.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Recipes.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Skins.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Titles.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Wallet.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Account.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Account.java index 0ed2e32..2e38920 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Account.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Account.java @@ -1,8 +1,19 @@ package me.xhsun.guildwars2wrapper.requests.v2.account; import java.io.IOException; +import java.util.List; + import me.xhsun.guildwars2wrapper.error.ErrorCode; import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.Color; +import me.xhsun.guildwars2wrapper.model.v2.Mini; +import me.xhsun.guildwars2wrapper.model.v2.Recipe; +import me.xhsun.guildwars2wrapper.model.v2.Skin; +import me.xhsun.guildwars2wrapper.model.v2.account.AchievementProgression; +import me.xhsun.guildwars2wrapper.model.v2.account.MaterialStorage; +import me.xhsun.guildwars2wrapper.model.v2.account.UnlockedFinisher; +import me.xhsun.guildwars2wrapper.model.v2.account.UnlockedMastery; +import me.xhsun.guildwars2wrapper.model.v2.util.Inventory; import me.xhsun.guildwars2wrapper.requests.GuildWars2API; import me.xhsun.guildwars2wrapper.requests.Request; import retrofit2.Call; @@ -52,4 +63,355 @@ public me.xhsun.guildwars2wrapper.model.v2.account.Account getAccountInfo(String } } + /** + * For more info on Account API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see AchievementProgression Account achievement info + */ + public void getAchievementProgression(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getAchievementProgression(API).enqueue(callback); + } + + //SYNC + /** + * For more info on Account API go here
+ * Get an account's progress towards all their achievements. + * + * @param API API key + * @return list of account achievement info + * @throws GuildWars2Exception see {@link ErrorCode} for detail + * @see AchievementProgression account achievement info + */ + public List getAchievementProgression(String API) throws GuildWars2Exception { + isParamValid(new ParamChecker(ParamType.API, API)); + try { + Response> response = gw2API.getAchievementProgression(API).execute(); + if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); + return response.body(); + } catch (IOException e) { + throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); + } + } + + /** + * For more info on Bank API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see me.xhsun.guildwars2wrapper.model.v2.util.Inventory Bank info + */ + public void getBank(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getBank(API).enqueue(callback); + } + + //SYNC + /** + * For more info on Bank API go here
+ * Get detailed info for bank linked to given API key + * + * @param API API key + * @return bank info + * @throws GuildWars2Exception see {@link ErrorCode} for detail + * @see me.xhsun.guildwars2wrapper.model.v2.util.Inventory Bank info + */ + public List getBank(String API) throws GuildWars2Exception { + isParamValid(new ParamChecker(ParamType.API, API)); + try { + Response> response = gw2API.getBank(API).execute(); + if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); + return response.body(); + } catch (IOException e) { + throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); + } + } + + /** + * For more info on Dungeon progression API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getDailyDungeonProgression(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getDailyDungeonProgression(API).enqueue(callback); + } + + //SYNC + /** + * For more info on Dungeon progression API go here
+ * + * @param API API key + * @return an array of strings representing dungeon path names completed since daily dungeon reset + * @throws GuildWars2Exception see {@link ErrorCode} for detail + */ + public List getDailyDungeonProgression(String API) throws GuildWars2Exception { + isParamValid(new ParamChecker(ParamType.API, API)); + try { + Response> response = gw2API.getDailyDungeonProgression(API).execute(); + if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); + return response.body(); + } catch (IOException e) { + throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); + } + } + + /** + * For more info on Account dyes API go here
+ * Get list of unlocked dyes ids linked to given API key + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see Color color info + */ + public void getUnlockedDyes(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedDyes(API).enqueue(callback); + } + + //SYNC + /** + * For more info on Account dyes API go here
+ * Get list of unlocked dyes ids linked to given API key + * + * @param API API key + * @return list of color ids + * @throws GuildWars2Exception see {@link ErrorCode} for detail + * @see Color + */ + public List getUnlockedDyes(String API) throws GuildWars2Exception { + isParamValid(new ParamChecker(ParamType.API, API)); + try { + Response> response = gw2API.getUnlockedDyes(API).execute(); + if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); + return response.body(); + } catch (IOException e) { + throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); + } + } + + /** + * For more info on Account finishers API go here
+ * Get list of unlocked finishers linked to given API key + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see UnlockedFinisher unlocked finisher info + */ + public void getUnlockedFinishers(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedFinishers(API).enqueue(callback); + } + + //SYNC + /** + * For more info on Account finishers API go here
+ * Get list of unlocked finishers linked to given API key + * + * @param API API key + * @return list of unlocked finisher info + * @throws GuildWars2Exception see {@link ErrorCode} for detail + * @see UnlockedFinisher unlocked finisher info + */ + public List getUnlockedFinishers(String API) throws GuildWars2Exception { + isParamValid(new ParamChecker(ParamType.API, API)); + try { + Response> response = gw2API.getUnlockedFinishers(API).execute(); + if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); + return response.body(); + } catch (IOException e) { + throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); + } + } + + /** + * For more info on Account gliders API go here
+ * Get list of unlocked glider id(s) linked to given API key + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getUnlockedGliders(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedGliders(API).enqueue(callback); + } + + /** + * For more info on Shared Inventory API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see me.xhsun.guildwars2wrapper.model.v2.util.Inventory shared inventory info + */ + public void getSharedInventory(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getSharedInventory(API).enqueue(callback); + } + + /** + * For more info on account mail carrier API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getUnlockedMailCarriers(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedMailCarriers(API).enqueue(callback); + } + + /** + * For more info on account masteries API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see UnlockedMastery unlocked mastery info + */ + public void getUnlockedMasteries(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedMasteries(API).enqueue(callback); + } + + /** + * For more info on MaterialCategory Storage API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see MaterialStorage material storage info + */ + public void getMaterialStorage(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getMaterialBank(API).enqueue(callback); + } + + /** + * For more info on account minis API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see Mini mini info + */ + public void getUnlockedMinis(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedMinis(API).enqueue(callback); + } + + /** + * For more info on account outfits API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getUnlockedOutfits(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedOutfits(API).enqueue(callback); + } + + /** + * For more info on account raid API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getWeeklyRaidProgression(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getWeeklyRaidProgression(API).enqueue(callback); + } + + /** + * For more info on account recipes API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see Recipe recipe info + */ + public void getUnlockedRecipes(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedRecipes(API).enqueue(callback); + } + + /** + * For more info on Account/Skins API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see Skin skin info + */ + public void getUnlockedSkins(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedSkins(API).enqueue(callback); + } + + /** + * For more info on Account titles API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getUnlockedTitles(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedTitles(API).enqueue(callback); + } + + /** + * For more info on Wallet API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see me.xhsun.guildwars2wrapper.model.v2.account.Wallet wallet info + */ + public void getWallet(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getWallet(API).enqueue(callback); + } } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Achievements.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Achievements.java deleted file mode 100644 index 1d45b96..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Achievements.java +++ /dev/null @@ -1,57 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account; - -import java.io.IOException; -import java.util.List; -import me.xhsun.guildwars2wrapper.error.ErrorCode; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.account.AchievementProgression; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Achievements extends Request { - - protected Achievements(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on Account API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - * @see AchievementProgression Account achievement info - */ - public void getAchievementProgression(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getAchievementProgression(API).enqueue(callback); - } - - //SYNC - /** - * For more info on Account API go here
- * Get an account's progress towards all their achievements. - * - * @param API API key - * @return list of account achievement info - * @throws GuildWars2Exception see {@link ErrorCode} for detail - * @see AchievementProgression account achievement info - */ - public List getAchievementProgression(String API) throws GuildWars2Exception { - isParamValid(new ParamChecker(ParamType.API, API)); - try { - Response> response = gw2API.getAchievementProgression(API).execute(); - if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); - return response.body(); - } catch (IOException e) { - throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); - } - } - -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Bank.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Bank.java deleted file mode 100644 index 898d132..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Bank.java +++ /dev/null @@ -1,56 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account; - -import java.io.IOException; -import java.util.List; -import me.xhsun.guildwars2wrapper.error.ErrorCode; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.util.Inventory; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Bank extends Request { - - protected Bank(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on Bank API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - * @see Inventory Bank info - */ - public void getBank(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getBank(API).enqueue(callback); - } - - //SYNC - /** - * For more info on Bank API go here
- * Get detailed info for bank linked to given API key - * - * @param API API key - * @return bank info - * @throws GuildWars2Exception see {@link ErrorCode} for detail - * @see Inventory Bank info - */ - public List getBank(String API) throws GuildWars2Exception { - isParamValid(new ParamChecker(ParamType.API, API)); - try { - Response> response = gw2API.getBank(API).execute(); - if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); - return response.body(); - } catch (IOException e) { - throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); - } - } -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dungeons.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dungeons.java deleted file mode 100644 index fa2fcb4..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dungeons.java +++ /dev/null @@ -1,52 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account; - -import java.io.IOException; -import java.util.List; -import me.xhsun.guildwars2wrapper.error.ErrorCode; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Dungeons extends Request { - - protected Dungeons(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on Dungeon progression API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - */ - public void getDailyDungeonProgression(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getDailyDungeonProgression(API).enqueue(callback); - } - - //SYNC - /** - * For more info on Dungeon progression API go here
- * - * @param API API key - * @return an array of strings representing dungeon path names completed since daily dungeon reset - * @throws GuildWars2Exception see {@link ErrorCode} for detail - */ - public List getDailyDungeonProgression(String API) throws GuildWars2Exception { - isParamValid(new ParamChecker(ParamType.API, API)); - try { - Response> response = gw2API.getDailyDungeonProgression(API).execute(); - if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); - return response.body(); - } catch (IOException e) { - throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); - } - } -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dyes.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dyes.java deleted file mode 100644 index 10f574b..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Dyes.java +++ /dev/null @@ -1,56 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account; - -import java.io.IOException; -import java.util.List; -import me.xhsun.guildwars2wrapper.error.ErrorCode; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.Color; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Dyes extends Request { - - protected Dyes(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on Account dyes API go here
- * Get list of unlocked dyes ids linked to given API key - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - * @see Color color info - */ - public void getUnlockedDyes(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getUnlockedDyes(API).enqueue(callback); - } - - //SYNC - /** - * For more info on Account dyes API go here
- * Get list of unlocked dyes ids linked to given API key - * - * @param API API key - * @return list of color ids - * @throws GuildWars2Exception see {@link ErrorCode} for detail - * @see Color - */ - public List getUnlockedDyes(String API) throws GuildWars2Exception { - isParamValid(new ParamChecker(ParamType.API, API)); - try { - Response> response = gw2API.getUnlockedDyes(API).execute(); - if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); - return response.body(); - } catch (IOException e) { - throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); - } - } -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Finishers.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Finishers.java deleted file mode 100644 index 2e9d7c3..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Finishers.java +++ /dev/null @@ -1,56 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account; - -import java.io.IOException; -import java.util.List; -import me.xhsun.guildwars2wrapper.error.ErrorCode; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.account.UnlockedFinisher; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Finishers extends Request { - - protected Finishers(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on Account finishers API go here
- * Get list of unlocked finishers linked to given API key - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - * @see UnlockedFinisher unlocked finisher info - */ - public void getUnlockedFinishers(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getUnlockedFinishers(API).enqueue(callback); - } - - //SYNC - /** - * For more info on Account finishers API go here
- * Get list of unlocked finishers linked to given API key - * - * @param API API key - * @return list of unlocked finisher info - * @throws GuildWars2Exception see {@link ErrorCode} for detail - * @see UnlockedFinisher unlocked finisher info - */ - public List getUnlockedFinishers(String API) throws GuildWars2Exception { - isParamValid(new ParamChecker(ParamType.API, API)); - try { - Response> response = gw2API.getUnlockedFinishers(API).execute(); - if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); - return response.body(); - } catch (IOException e) { - throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); - } - } -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Gliders.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Gliders.java deleted file mode 100644 index 4c2f34b..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Gliders.java +++ /dev/null @@ -1,31 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account; - -import java.util.List; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; - -public class Gliders extends Request { - - protected Gliders(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on Account gliders API go here
- * Get list of unlocked glider id(s) linked to given API key - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - */ - public void getUnlockedGliders(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getUnlockedGliders(API).enqueue(callback); - } - -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Inventory.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Inventory.java deleted file mode 100644 index 0c499af..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Inventory.java +++ /dev/null @@ -1,34 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account; - -import java.util.List; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Inventory extends Request { - - protected Inventory(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on Shared Inventory API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - * @see me.xhsun.guildwars2wrapper.model.v2.util.Inventory shared inventory info - */ - public void getSharedInventory(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getSharedInventory(API).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Mailcarriers.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Mailcarriers.java deleted file mode 100644 index 8523a44..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Mailcarriers.java +++ /dev/null @@ -1,33 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account; - -import java.util.List; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Mailcarriers extends Request { - - protected Mailcarriers(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on account mail carrier API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - */ - public void getUnlockedMailCarriers(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getUnlockedMailCarriers(API).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Masteries.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Masteries.java deleted file mode 100644 index b050a52..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Masteries.java +++ /dev/null @@ -1,35 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account; - -import java.util.List; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.account.UnlockedMastery; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Masteries extends Request { - - protected Masteries(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on account masteries API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - * @see UnlockedMastery unlocked mastery info - */ - public void getUnlockedMasteries(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getUnlockedMasteries(API).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Materials.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Materials.java deleted file mode 100644 index cf324ad..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Materials.java +++ /dev/null @@ -1,35 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account; - -import java.util.List; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.account.MaterialStorage; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Materials extends Request { - - protected Materials(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on MaterialCategory Storage API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - * @see MaterialStorage material storage info - */ - public void getMaterialStorage(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getMaterialBank(API).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Minis.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Minis.java deleted file mode 100644 index 4cd9bf4..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Minis.java +++ /dev/null @@ -1,35 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account; - -import java.util.List; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.Mini; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Minis extends Request { - - protected Minis(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on account minis API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - * @see Mini mini info - */ - public void getUnlockedMinis(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getUnlockedMinis(API).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Outfits.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Outfits.java deleted file mode 100644 index 5f329ef..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Outfits.java +++ /dev/null @@ -1,33 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account; - -import java.util.List; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Outfits extends Request { - - protected Outfits(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on account outfits API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - */ - public void getUnlockedOutfits(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getUnlockedOutfits(API).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Raids.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Raids.java deleted file mode 100644 index cc3aa15..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Raids.java +++ /dev/null @@ -1,33 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account; - -import java.util.List; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Raids extends Request { - - protected Raids(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on account raid API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - */ - public void getWeeklyRaidProgression(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getWeeklyRaidProgression(API).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Recipes.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Recipes.java deleted file mode 100644 index 74f8cb9..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Recipes.java +++ /dev/null @@ -1,35 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account; - -import java.util.List; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.Recipe; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Recipes extends Request { - - protected Recipes(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on account recipes API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - * @see Recipe recipe info - */ - public void getUnlockedRecipes(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getUnlockedRecipes(API).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Skins.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Skins.java deleted file mode 100644 index 152f7a5..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Skins.java +++ /dev/null @@ -1,35 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account; - -import java.util.List; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.Skin; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Skins extends Request { - - protected Skins(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on Account/Skins API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - * @see Skin skin info - */ - public void getUnlockedSkins(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getUnlockedSkins(API).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Titles.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Titles.java deleted file mode 100644 index 31584b9..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Titles.java +++ /dev/null @@ -1,33 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account; - -import java.util.List; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Titles extends Request { - - protected Titles(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on Account titles API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - */ - public void getUnlockedTitles(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getUnlockedTitles(API).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Wallet.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Wallet.java deleted file mode 100644 index 1209d1c..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Wallet.java +++ /dev/null @@ -1,34 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account; - -import java.util.List; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Wallet extends Request { - - protected Wallet(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on Wallet API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - * @see me.xhsun.guildwars2wrapper.model.v2.account.Wallet wallet info - */ - public void getWallet(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getWallet(API).enqueue(callback); - } - - //SYNC -} From e8fcf8bc289739f93f8d39bc6c3a6f7aab9bddfa Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 2 Mar 2019 19:57:09 +0100 Subject: [PATCH 37/46] Account request async v2 --- .../requests/v2/account/Account.java | 56 +++++++++++++++---- .../requests/v2/account/home/Cats.java | 34 ----------- .../requests/v2/account/home/Nodes.java | 32 ----------- .../requests/v2/account/pvp/Heroes.java | 33 ----------- 4 files changed, 46 insertions(+), 109 deletions(-) delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Cats.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Nodes.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/pvp/Heroes.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Account.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Account.java index 2e38920..3f97c93 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Account.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/Account.java @@ -5,10 +5,7 @@ import me.xhsun.guildwars2wrapper.error.ErrorCode; import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.Color; -import me.xhsun.guildwars2wrapper.model.v2.Mini; -import me.xhsun.guildwars2wrapper.model.v2.Recipe; -import me.xhsun.guildwars2wrapper.model.v2.Skin; +import me.xhsun.guildwars2wrapper.model.v2.*; import me.xhsun.guildwars2wrapper.model.v2.account.AchievementProgression; import me.xhsun.guildwars2wrapper.model.v2.account.MaterialStorage; import me.xhsun.guildwars2wrapper.model.v2.account.UnlockedFinisher; @@ -42,7 +39,6 @@ public void getAccountInfo(String API, Callbackhere
* Get detailed info for account link to given API key @@ -78,7 +74,6 @@ public void getAchievementProgression(String API, Callbackhere
* Get an account's progress towards all their achievements. @@ -114,7 +109,6 @@ public void getBank(String API, Callbackhere
* Get detailed info for bank linked to given API key @@ -149,7 +143,6 @@ public void getDailyDungeonProgression(String API, Callback> callba gw2API.getDailyDungeonProgression(API).enqueue(callback); } - //SYNC /** * For more info on Dungeon progression API go here
* @@ -183,7 +176,6 @@ public void getUnlockedDyes(String API, Callback> callback) throws gw2API.getUnlockedDyes(API).enqueue(callback); } - //SYNC /** * For more info on Account dyes API go here
* Get list of unlocked dyes ids linked to given API key @@ -219,7 +211,6 @@ public void getUnlockedFinishers(String API, Callback> ca gw2API.getUnlockedFinishers(API).enqueue(callback); } - //SYNC /** * For more info on Account finishers API go here
* Get list of unlocked finishers linked to given API key @@ -414,4 +405,49 @@ public void getWallet(String API, Callbackhere
+ * Get list of unlocked cats linked to given API key + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see Cat cat info + */ + public void getUnlockedCats(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedCats(API).enqueue(callback); + } + + /** + * For more info on Account nodes API go here
+ * Get list of unlocked glider id(s) linked to given API key + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getUnlockedHomeNodes(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedHomeNodes(API).enqueue(callback); + } + + /** + * For more info on account pvp heroes API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getUnlockedPvpHeroes(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getUnlockedPvpHeroes(API).enqueue(callback); + } + + //SYNC } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Cats.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Cats.java deleted file mode 100644 index 972ad08..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Cats.java +++ /dev/null @@ -1,34 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account.home; - -import java.util.List; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.Cat; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; - -public class Cats extends Request { - - protected Cats(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on Account cats API go here
- * Get list of unlocked cats linked to given API key - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - * @see Cat cat info - */ - public void getUnlockedCats(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getUnlockedCats(API).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Nodes.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Nodes.java deleted file mode 100644 index 0778f85..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/home/Nodes.java +++ /dev/null @@ -1,32 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account.home; - -import java.util.List; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; - -public class Nodes extends Request { - - protected Nodes(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on Account nodes API go here
- * Get list of unlocked glider id(s) linked to given API key - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - */ - public void getUnlockedHomeNodes(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getUnlockedHomeNodes(API).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/pvp/Heroes.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/pvp/Heroes.java deleted file mode 100644 index c3c6924..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/account/pvp/Heroes.java +++ /dev/null @@ -1,33 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.account.pvp; - -import java.util.List; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Heroes extends Request { - - protected Heroes(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on account pvp heroes API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - */ - public void getUnlockedPvpHeroes(String API, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getUnlockedPvpHeroes(API).enqueue(callback); - } - - //SYNC -} From 47bac0078256ecb7c0487b8ea2a84c21a494c10f Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 2 Mar 2019 20:00:07 +0100 Subject: [PATCH 38/46] Achievemnt request async v2 --- .../v2/achievements/Achievements.java | 80 +++++++++++++++++++ .../achievements/Categories/Categories.java | 48 ----------- .../requests/v2/achievements/daily/Daily.java | 44 ---------- .../v2/achievements/groups/Groups.java | 48 ----------- 4 files changed, 80 insertions(+), 140 deletions(-) delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/Categories/Categories.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/daily/Daily.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/groups/Groups.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/Achievements.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/Achievements.java index f3b455c..7e5fea7 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/Achievements.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/Achievements.java @@ -5,6 +5,7 @@ import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; import me.xhsun.guildwars2wrapper.model.v2.achievement.Achievement; import me.xhsun.guildwars2wrapper.model.v2.achievement.AchievementCategory; +import me.xhsun.guildwars2wrapper.model.v2.achievement.AchievementGroup; import me.xhsun.guildwars2wrapper.model.v2.achievement.DailyAchievement; import me.xhsun.guildwars2wrapper.requests.GuildWars2API; import me.xhsun.guildwars2wrapper.requests.Request; @@ -46,5 +47,84 @@ public void getAchievementInfo(int[] ids, Callback> callback) gw2API.getAchievementInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); } + /** + * For more info on achievement categories API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see AchievementCategory achievement category info + */ + public void getAllAchievementCategoryIDs(Callback> callback) throws NullPointerException { + gw2API.getAllAchievementCategoryIDs().enqueue(callback); + } + + /** + * For more info on achievements categories API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of achievement category id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see AchievementCategory achievement category info + */ + public void getAchievementCategoryInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getAchievementCategoryInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + /** + * For more info on achievements daily API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see DailyAchievement daily achievement info + */ + public void getCurrentDailyAchievements(Callback callback) throws NullPointerException { + gw2API.getCurrentDailyAchievements().enqueue(callback); + } + + /** + * For more info on next achievements daily API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see DailyAchievement daily achievement info + */ + public void getNextDailyAchievements(Callback callback) throws GuildWars2Exception, NullPointerException { + gw2API.getNextDailyAchievements().enqueue(callback); + } + + /** + * For more info on achievements groups API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see AchievementGroup achievement group info + */ + public void getAllAchievementGroupID(Callback> callback) throws NullPointerException { + gw2API.getAllAchievementGroupIDs().enqueue(callback); + } + + /** + * For more info on achievements groups API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of achievement group id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see AchievementGroup achievement group info + */ + public void getAchievementGroupInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getAchievementGroupInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + //SYNC } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/Categories/Categories.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/Categories/Categories.java deleted file mode 100644 index d8f8baf..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/Categories/Categories.java +++ /dev/null @@ -1,48 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.achievements.Categories; - -import java.util.List; -import me.xhsun.guildwars2wrapper.GuildWars2; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.achievement.AchievementCategory; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Categories extends Request { - - protected Categories(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on achievement categories API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see AchievementCategory achievement category info - */ - public void getAllAchievementCategoryIDs(Callback> callback) throws NullPointerException { - gw2API.getAllAchievementCategoryIDs().enqueue(callback); - } - - /** - * For more info on achievements categories API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param ids list of achievement category id(s) - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - * @see AchievementCategory achievement category info - */ - public void getAchievementCategoryInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ids)); - gw2API.getAchievementCategoryInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/daily/Daily.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/daily/Daily.java deleted file mode 100644 index 6779252..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/daily/Daily.java +++ /dev/null @@ -1,44 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.achievements.daily; - -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.achievement.DailyAchievement; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Daily extends Request { - - protected Daily(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on achievements daily API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see DailyAchievement daily achievement info - */ - public void getCurrentDailyAchievements(Callback callback) throws NullPointerException { - gw2API.getCurrentDailyAchievements().enqueue(callback); - } - - /** - * For more info on next achievements daily API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - * @see DailyAchievement daily achievement info - */ - public void getNextDailyAchievements(Callback callback) throws GuildWars2Exception, NullPointerException { - gw2API.getNextDailyAchievements().enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/groups/Groups.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/groups/Groups.java deleted file mode 100644 index e57e276..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/achievements/groups/Groups.java +++ /dev/null @@ -1,48 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.achievements.groups; - -import java.util.List; -import me.xhsun.guildwars2wrapper.GuildWars2; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.achievement.AchievementGroup; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Groups extends Request { - - protected Groups(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on achievements groups API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see AchievementGroup achievement group info - */ - public void getAllAchievementGroupID(Callback> callback) throws NullPointerException { - gw2API.getAllAchievementGroupIDs().enqueue(callback); - } - - /** - * For more info on achievements groups API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param ids list of achievement group id(s) - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - * @see AchievementGroup achievement group info - */ - public void getAchievementGroupInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ids)); - gw2API.getAchievementGroupInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); - } - - //SYNC -} From 03072e9b6d5448b7d1e9881fc58c9b4324fd09da Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 2 Mar 2019 20:00:17 +0100 Subject: [PATCH 39/46] Backstory async request v2 --- .../requests/v2/backstory/Answers.java | 48 ------------------- .../{Questions.java => Backstory.java} | 37 ++++++++++++-- 2 files changed, 33 insertions(+), 52 deletions(-) delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/backstory/Answers.java rename src/main/java/me/xhsun/guildwars2wrapper/requests/v2/backstory/{Questions.java => Backstory.java} (54%) diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/backstory/Answers.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/backstory/Answers.java deleted file mode 100644 index 2514617..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/backstory/Answers.java +++ /dev/null @@ -1,48 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.backstory; - -import java.util.List; -import me.xhsun.guildwars2wrapper.GuildWars2; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.backstory.BackStoryAnswer; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Answers extends Request { - - protected Answers(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on back story answer API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see BackStoryAnswer back story answer info - */ - public void getAllBackStoryAnswerID(Callback> callback) throws NullPointerException { - gw2API.getAllBackStoryAnswerIDs().enqueue(callback); - } - - /** - * For more info on back story answer API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param ids list of back story answer id(s) - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - * @see BackStoryAnswer back story answer info - */ - public void getBackStoryAnswerInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ids)); - gw2API.getBackStoryAnswerInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/backstory/Questions.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/backstory/Backstory.java similarity index 54% rename from src/main/java/me/xhsun/guildwars2wrapper/requests/v2/backstory/Questions.java rename to src/main/java/me/xhsun/guildwars2wrapper/requests/v2/backstory/Backstory.java index 9f7c0d4..5428aab 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/backstory/Questions.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/backstory/Backstory.java @@ -1,8 +1,8 @@ package me.xhsun.guildwars2wrapper.requests.v2.backstory; -import java.util.List; import me.xhsun.guildwars2wrapper.GuildWars2; import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.backstory.BackStoryAnswer; import me.xhsun.guildwars2wrapper.model.v2.backstory.BackStoryQuestion; import me.xhsun.guildwars2wrapper.requests.GuildWars2API; import me.xhsun.guildwars2wrapper.requests.Request; @@ -10,13 +10,42 @@ import retrofit2.Callback; import retrofit2.Response; -public class Questions extends Request { +import java.util.List; + +public class Backstory extends Request { - protected Questions(GuildWars2API gw2API) { + protected Backstory(GuildWars2API gw2API) { super(gw2API); } //ASYNC + /** + * For more info on back story answer API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see BackStoryAnswer back story answer info + */ + public void getAllBackStoryAnswerID(Callback> callback) throws NullPointerException { + gw2API.getAllBackStoryAnswerIDs().enqueue(callback); + } + + /** + * For more info on back story answer API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of back story answer id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see BackStoryAnswer back story answer info + */ + public void getBackStoryAnswerInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getBackStoryAnswerInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + /** * For more info on back story questions API go here
* Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions @@ -44,5 +73,5 @@ public void getBackStoryQuestionInfo(int[] ids, Callback gw2API.getBackStoryQuestionInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); } - //ASYNC + //SYNC } From 3736e6207d3bcad44880a9e066da110ae3d7e6d9 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 2 Mar 2019 20:02:07 +0100 Subject: [PATCH 40/46] Commerce request async v2 --- .../requests/v2/commerce/Commerce.java | 125 ++++++++++++++++++ .../requests/v2/commerce/Prices.java | 61 --------- .../requests/v2/commerce/Transactions.java | 40 ------ .../v2/commerce/delivery/Delivery.java | 33 ----- .../requests/v2/commerce/exchange/Coins.java | 35 ----- .../v2/commerce/exchange/Exchange.java | 29 ---- 6 files changed, 125 insertions(+), 198 deletions(-) create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/Commerce.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/Prices.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/Transactions.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/delivery/Delivery.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/exchange/Coins.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/exchange/Exchange.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/Commerce.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/Commerce.java new file mode 100644 index 0000000..f671da5 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/Commerce.java @@ -0,0 +1,125 @@ +package me.xhsun.guildwars2wrapper.requests.v2.commerce; + +import me.xhsun.guildwars2wrapper.error.ErrorCode; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.commerce.Exchange; +import me.xhsun.guildwars2wrapper.model.v2.commerce.Listing; +import me.xhsun.guildwars2wrapper.model.v2.commerce.Transaction; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Commerce extends Request { + protected Commerce(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on Listing Price API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of item id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see Listing listing item price info + */ + public void getTPListingInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getTPListingInfo(processIds(ids)).enqueue(callback); + } + + /** + * For more info on Listing Price API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getAllPriceID(Callback> callback) throws NullPointerException { + gw2API.getAllTPPriceIDs().enqueue(callback); + } + + /** + * For more info on Listing Price API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of item id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see me.xhsun.guildwars2wrapper.model.v2.commerce.Prices listing item price info + */ + public void getPriceInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getTPPriceInfo(processIds(ids)).enqueue(callback); + } + + /** + * For more info on transactions API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param time current | History + * @param type buy | sell + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see Transaction transaction info + */ + public void getTPTransaction(String API, Transaction.Time time, Transaction.Type type, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + if (time == null || type == null) + throw new GuildWars2Exception(ErrorCode.TransTime, "Transaction time/type cannot be empty"); + gw2API.getTPTransaction(time.getValue(), type.getValue(), API).enqueue(callback); + } + + /** + * For more info on delivery API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param API API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid API key + * @throws NullPointerException if given {@link Callback} is empty + * @see me.xhsun.guildwars2wrapper.model.v2.commerce.Delivery devlivery info + */ + public void getTPDeliveryInfo(String API, Callback callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, API)); + gw2API.getTPDeliveryInfo(API).enqueue(callback); + } + + /** + * For more info on exchange coins API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param currency exchange currency type + * @param quantity The amount to exchange + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception invalid value + * @throws NullPointerException if given {@link Callback} is empty + * @see me.xhsun.guildwars2wrapper.model.v2.commerce.Exchange Exchange info + */ + public void getExchangeInfo(me.xhsun.guildwars2wrapper.model.v2.commerce.Exchange.Type currency, long quantity, Callback callback) throws GuildWars2Exception, NullPointerException { + isValueValid(quantity); + gw2API.getExchangeInfo(currency.name(), Long.toString(quantity)).enqueue(callback); + } + + /** + * For more info on exchange API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getAllExchangeCurrency(Callback> callback) throws NullPointerException { + gw2API.getAllExchangeCurrency().enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/Prices.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/Prices.java deleted file mode 100644 index 02a555c..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/Prices.java +++ /dev/null @@ -1,61 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.commerce; - -import java.util.List; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.commerce.Listing; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Prices extends Request { - - protected Prices(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on Listing Price API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param ids list of item id - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception empty ID list - * @throws NullPointerException if given {@link Callback} is empty - * @see Listing listing item price info - */ - public void getTPListingInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ids)); - gw2API.getTPListingInfo(processIds(ids)).enqueue(callback); - } - - /** - * For more info on Listing Price API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - */ - public void getAllPriceID(Callback> callback) throws NullPointerException { - gw2API.getAllTPPriceIDs().enqueue(callback); - } - - /** - * For more info on Listing Price API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param ids list of item id - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception empty ID list - * @throws NullPointerException if given {@link Callback} is empty - * @see me.xhsun.guildwars2wrapper.model.v2.commerce.Prices listing item price info - */ - public void getPriceInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ids)); - gw2API.getTPPriceInfo(processIds(ids)).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/Transactions.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/Transactions.java deleted file mode 100644 index cad4e2c..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/Transactions.java +++ /dev/null @@ -1,40 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.commerce; - -import java.util.List; -import me.xhsun.guildwars2wrapper.error.ErrorCode; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.commerce.Transaction; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Transactions extends Request { - - protected Transactions(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on transactions API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param API API key - * @param time current | History - * @param type buy | sell - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - * @see Transaction transaction info - */ - public void getTPTransaction(String API, Transaction.Time time, Transaction.Type type, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - if (time == null || type == null) - throw new GuildWars2Exception(ErrorCode.TransTime, "Transaction time/type cannot be empty"); - gw2API.getTPTransaction(time.getValue(), type.getValue(), API).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/delivery/Delivery.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/delivery/Delivery.java deleted file mode 100644 index 68a3c76..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/delivery/Delivery.java +++ /dev/null @@ -1,33 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.commerce.delivery; - -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Delivery extends Request { - - protected Delivery(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on delivery API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param API API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid API key - * @throws NullPointerException if given {@link Callback} is empty - * @see me.xhsun.guildwars2wrapper.model.v2.commerce.Delivery devlivery info - */ - public void getTPDeliveryInfo(String API, Callback callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, API)); - gw2API.getTPDeliveryInfo(API).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/exchange/Coins.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/exchange/Coins.java deleted file mode 100644 index de64bb8..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/exchange/Coins.java +++ /dev/null @@ -1,35 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.commerce.exchange; - -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.commerce.Exchange; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Coins extends Request { - - protected Coins(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on exchange coins API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param currency exchange currency type - * @param quantity The amount to exchange - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception invalid value - * @throws NullPointerException if given {@link Callback} is empty - * @see me.xhsun.guildwars2wrapper.model.v2.commerce.Exchange Exchange info - */ - public void getExchangeInfo(me.xhsun.guildwars2wrapper.model.v2.commerce.Exchange.Type currency, long quantity, Callback callback) throws GuildWars2Exception, NullPointerException { - isValueValid(quantity); - gw2API.getExchangeInfo(currency.name(), Long.toString(quantity)).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/exchange/Exchange.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/exchange/Exchange.java deleted file mode 100644 index d674d1d..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/commerce/exchange/Exchange.java +++ /dev/null @@ -1,29 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.commerce.exchange; - -import java.util.List; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Exchange extends Request { - - protected Exchange(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on exchange API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - */ - public void getAllExchangeCurrency(Callback> callback) throws NullPointerException { - gw2API.getAllExchangeCurrency().enqueue(callback); - } - - //SYNC -} From 11a111287652c059c318c088eb3181b2aa82b6a5 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 2 Mar 2019 20:09:24 +0100 Subject: [PATCH 41/46] Guild request async v2 --- .../requests/v2/guild/Guild.java | 163 ++++++++++++++++++ .../requests/v2/guild/Permissions.java | 48 ------ .../requests/v2/guild/Search.java | 35 ---- .../requests/v2/guild/Upgrades.java | 48 ------ .../requests/v2/guild/id/Log.java | 51 ------ .../requests/v2/guild/id/Members.java | 35 ---- .../requests/v2/guild/id/Teams.java | 35 ---- .../requests/v2/guild/id/Treasury.java | 35 ---- .../requests/v2/guild/id/Upgrades.java | 33 ---- 9 files changed, 163 insertions(+), 320 deletions(-) delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Permissions.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Search.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Upgrades.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Log.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Members.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Teams.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Treasury.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Upgrades.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Guild.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Guild.java index ed53a27..1a3422f 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Guild.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Guild.java @@ -1,12 +1,16 @@ package me.xhsun.guildwars2wrapper.requests.v2.guild; +import me.xhsun.guildwars2wrapper.GuildWars2; import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.guild.*; import me.xhsun.guildwars2wrapper.requests.GuildWars2API; import me.xhsun.guildwars2wrapper.requests.Request; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; +import java.util.List; + public class Guild extends Request { protected Guild(GuildWars2API gw2API) { super(gw2API); @@ -44,5 +48,164 @@ public void getDetailedGuildInfo(String id, String api, Callbackhere
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see GuildPermission guild permission info + */ + public void getAllGuildPermissionID(Callback> callback) throws NullPointerException { + gw2API.getAllGuildPermissionIDs().enqueue(callback); + } + + /** + * For more info on guild permissions API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of guild permission id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see GuildPermission guild permission info + */ + public void getGuildPermissionInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getGuildPermissionInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + /** + * For more info on guild Search API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param name guild name + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see GuildPermission guild permission info + */ + public void searchGuildID(String name, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.GUILD, name)); + gw2API.searchGuildID(name).enqueue(callback); + } + + /** + * For more info on guild upgrades API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see GuildUpgrade guild upgrade info + */ + public void getGuildUpgradeID(Callback> callback) throws NullPointerException { + gw2API.getAllGuildUpgradeIDs().enqueue(callback); + } + + /** + * For more info on guild upgrades API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of guild upgrade id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see GuildUpgrade guild upgrade info + */ + public void getGuildUpgradeInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getGuildUpgradeInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + /** + * For more info on guild log API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
+ * + * @param id guild id + * @param api Guild leader's Guild Wars 2 API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see GuildLog guild log info + */ + public void getGuildLogInfo(String id, String api, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); + gw2API.getGuildLogInfo(id, api).enqueue(callback); + } + + /** + * For more info on guild log API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
+ * + * @param id guild id + * @param api Guild leader's Guild Wars 2 API key + * @param since log id used to filter log entries + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see GuildLog guild log info + */ + public void getFilteredGuildLogInfo(String id, String api, int since, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); + gw2API.getFilteredGuildLogInfo(id, api, Integer.toString(since)).enqueue(callback); + } + + /** + * For more info on guild member API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
+ * + * @param id guild id + * @param api Guild leader's Guild Wars 2 API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see GuildMember guild member info + */ + public void getGuildMemberInfo(String id, String api, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); + gw2API.getGuildMemberInfo(id, api).enqueue(callback); + } + + /** + * For more info on guild teams API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
+ * + * @param id guild id + * @param api Guild leader's Guild Wars 2 API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see GuildTeam guild team info + */ + public void getGuildTeamsInfo(String id, String api, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); + gw2API.getGuildTeamsInfo(id, api).enqueue(callback); + } + + /** + * For more info on guild treasury API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
+ * + * @param id guild id + * @param api Guild leader's Guild Wars 2 API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see GuildTreasury guild treasury info + */ + public void getGuildTreasuryInfo(String id, String api, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); + gw2API.getGuildTreasuryInfo(id, api).enqueue(callback); + } + + /** + * For more info on guild unlocked upgrades API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
+ * + * @param id guild id + * @param api Guild leader's Guild Wars 2 API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + */ + public void getGuildUnlockedUpgradesID(String id, String api, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); + gw2API.getGuildUpgradeIDs(id, api).enqueue(callback); + } + //SYNC } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Permissions.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Permissions.java deleted file mode 100644 index e1e41f5..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Permissions.java +++ /dev/null @@ -1,48 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.guild; - -import me.xhsun.guildwars2wrapper.GuildWars2; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.guild.GuildPermission; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Permissions extends Request { - protected Permissions(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on guild permissions API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see GuildPermission guild permission info - */ - public void getAllGuildPermissionID(Callback> callback) throws NullPointerException { - gw2API.getAllGuildPermissionIDs().enqueue(callback); - } - - /** - * For more info on guild permissions API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param ids list of guild permission id - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception empty ID list - * @throws NullPointerException if given {@link Callback} is empty - * @see GuildPermission guild permission info - */ - public void getGuildPermissionInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ids)); - gw2API.getGuildPermissionInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Search.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Search.java deleted file mode 100644 index ecbcdac..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Search.java +++ /dev/null @@ -1,35 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.guild; - -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.guild.GuildPermission; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Search extends Request { - protected Search(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on guild Search API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param name guild name - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception empty ID list - * @throws NullPointerException if given {@link Callback} is empty - * @see GuildPermission guild permission info - */ - public void searchGuildID(String name, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.GUILD, name)); - gw2API.searchGuildID(name).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Upgrades.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Upgrades.java deleted file mode 100644 index 68993b7..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/Upgrades.java +++ /dev/null @@ -1,48 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.guild; - -import me.xhsun.guildwars2wrapper.GuildWars2; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.guild.GuildUpgrade; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Upgrades extends Request { - protected Upgrades(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on guild upgrades API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see GuildUpgrade guild upgrade info - */ - public void getGuildUpgradeID(Callback> callback) throws NullPointerException { - gw2API.getAllGuildUpgradeIDs().enqueue(callback); - } - - /** - * For more info on guild upgrades API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param ids list of guild upgrade id - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception empty ID list - * @throws NullPointerException if given {@link Callback} is empty - * @see GuildUpgrade guild upgrade info - */ - public void getGuildUpgradeInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ids)); - gw2API.getGuildUpgradeInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Log.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Log.java deleted file mode 100644 index 72f46e9..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Log.java +++ /dev/null @@ -1,51 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.guild.id; - -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.guild.GuildLog; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Log extends Request { - protected Log(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on guild log API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
- * - * @param id guild id - * @param api Guild leader's Guild Wars 2 API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see GuildLog guild log info - */ - public void getGuildLogInfo(String id, String api, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); - gw2API.getGuildLogInfo(id, api).enqueue(callback); - } - - /** - * For more info on guild log API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
- * - * @param id guild id - * @param api Guild leader's Guild Wars 2 API key - * @param since log id used to filter log entries - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see GuildLog guild log info - */ - public void getFilteredGuildLogInfo(String id, String api, int since, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); - gw2API.getFilteredGuildLogInfo(id, api, Integer.toString(since)).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Members.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Members.java deleted file mode 100644 index 41de3c6..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Members.java +++ /dev/null @@ -1,35 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.guild.id; - -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.guild.GuildMember; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Members extends Request { - protected Members(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on guild member API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
- * - * @param id guild id - * @param api Guild leader's Guild Wars 2 API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see GuildMember guild member info - */ - public void getGuildMemberInfo(String id, String api, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); - gw2API.getGuildMemberInfo(id, api).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Teams.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Teams.java deleted file mode 100644 index 03d56c9..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Teams.java +++ /dev/null @@ -1,35 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.guild.id; - -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.guild.GuildTeam; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Teams extends Request { - protected Teams(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on guild teams API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
- * - * @param id guild id - * @param api Guild leader's Guild Wars 2 API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see GuildTeam guild team info - */ - public void getGuildTeamsInfo(String id, String api, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); - gw2API.getGuildTeamsInfo(id, api).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Treasury.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Treasury.java deleted file mode 100644 index bd288ac..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Treasury.java +++ /dev/null @@ -1,35 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.guild.id; - -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.guild.GuildTreasury; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Treasury extends Request { - protected Treasury(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on guild treasury API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
- * - * @param id guild id - * @param api Guild leader's Guild Wars 2 API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see GuildTreasury guild treasury info - */ - public void getGuildTreasuryInfo(String id, String api, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); - gw2API.getGuildTreasuryInfo(id, api).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Upgrades.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Upgrades.java deleted file mode 100644 index f416e01..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/guild/id/Upgrades.java +++ /dev/null @@ -1,33 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.guild.id; - -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Upgrades extends Request { - protected Upgrades(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on guild unlocked upgrades API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
- * - * @param id guild id - * @param api Guild leader's Guild Wars 2 API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - */ - public void getGuildUnlockedUpgradesID(String id, String api, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.GUILD, id), new ParamChecker(ParamType.API, api)); - gw2API.getGuildUpgradeIDs(id, api).enqueue(callback); - } - - //SYNC -} From 656bf466533079b77bdda916a14d88bea323b422 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 2 Mar 2019 20:09:37 +0100 Subject: [PATCH 42/46] Pvp request async v2 --- .../requests/v2/pvp/Amulets.java | 48 ---- .../requests/v2/pvp/Games.java | 51 ----- .../requests/v2/pvp/Heroes.java | 48 ---- .../requests/v2/pvp/Pvp.java | 206 ++++++++++++++++++ .../requests/v2/pvp/Ranks.java | 48 ---- .../requests/v2/pvp/Seasons.java | 48 ---- .../requests/v2/pvp/Standings.java | 36 --- .../requests/v2/pvp/Stats.java | 33 --- .../requests/v2/pvp/id/Leaderboard.java | 35 --- 9 files changed, 206 insertions(+), 347 deletions(-) delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Amulets.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Games.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Heroes.java create mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Pvp.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Ranks.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Seasons.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Standings.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Stats.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/id/Leaderboard.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Amulets.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Amulets.java deleted file mode 100644 index afdada0..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Amulets.java +++ /dev/null @@ -1,48 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.pvp; - -import me.xhsun.guildwars2wrapper.GuildWars2; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.pvp.PvPAmulet; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Amulets extends Request { - protected Amulets(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on pvp amulets API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see PvPAmulet amulet info - */ - public void getAllPvPAmuletID(Callback> callback) throws NullPointerException { - gw2API.getAllPvPAmuletIDs().enqueue(callback); - } - - /** - * For more info on pvp amulets API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param ids list of amulet id - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception empty ID list - * @throws NullPointerException if given {@link Callback} is empty - * @see PvPAmulet amulet info - */ - public void getPvPAmuletInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ids)); - gw2API.getPvPAmuletInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Games.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Games.java deleted file mode 100644 index 32eb784..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Games.java +++ /dev/null @@ -1,51 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.pvp; - -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.pvp.PvPGame; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Games extends Request { - protected Games(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on pvp games API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param api Guild Wars 2 API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @throws GuildWars2Exception invalid API key - * @see PvPGame pvp game info - */ - public void getAllPvPGameID(String api, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, api)); - gw2API.getAllPvPGameIDs(api).enqueue(callback); - } - - /** - * For more info on pvp games API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param api Guild Wars 2 API key - * @param ids list of pvp game id - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception empty ID list - * @throws NullPointerException if given {@link Callback} is empty - * @see PvPGame pvp game info - */ - public void getPvPGameInfo(String api, String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, api), new ParamChecker(ids)); - gw2API.getPvPGameInfo(api, processIds(ids)).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Heroes.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Heroes.java deleted file mode 100644 index 3b31c28..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Heroes.java +++ /dev/null @@ -1,48 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.pvp; - -import me.xhsun.guildwars2wrapper.GuildWars2; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.pvp.PvPHero; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Heroes extends Request { - protected Heroes(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on pvp heroes API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see PvPHero pvp hero info - */ - public void getAllPvPHeroID(Callback> callback) throws NullPointerException { - gw2API.getAllPvPHeroIDs().enqueue(callback); - } - - /** - * For more info on pvp heroes API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param ids list of pvp hero id - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception empty ID list - * @throws NullPointerException if given {@link Callback} is empty - * @see PvPHero pvp hero info - */ - public void getPvPHeroInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ids)); - gw2API.getPvPHeroInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Pvp.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Pvp.java new file mode 100644 index 0000000..2ab17f5 --- /dev/null +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Pvp.java @@ -0,0 +1,206 @@ +package me.xhsun.guildwars2wrapper.requests.v2.pvp; + +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.World; +import me.xhsun.guildwars2wrapper.model.v2.pvp.*; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Pvp extends Request { + protected Pvp(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on pvp amulets API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see PvPAmulet amulet info + */ + public void getAllPvPAmuletID(Callback> callback) throws NullPointerException { + gw2API.getAllPvPAmuletIDs().enqueue(callback); + } + + /** + * For more info on pvp amulets API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of amulet id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see PvPAmulet amulet info + */ + public void getPvPAmuletInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getPvPAmuletInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + /** + * For more info on pvp games API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param api Guild Wars 2 API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @throws GuildWars2Exception invalid API key + * @see PvPGame pvp game info + */ + public void getAllPvPGameID(String api, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, api)); + gw2API.getAllPvPGameIDs(api).enqueue(callback); + } + + /** + * For more info on pvp games API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param api Guild Wars 2 API key + * @param ids list of pvp game id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see PvPGame pvp game info + */ + public void getPvPGameInfo(String api, String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, api), new ParamChecker(ids)); + gw2API.getPvPGameInfo(api, processIds(ids)).enqueue(callback); + } + + /** + * For more info on pvp heroes API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see PvPHero pvp hero info + */ + public void getAllPvPHeroID(Callback> callback) throws NullPointerException { + gw2API.getAllPvPHeroIDs().enqueue(callback); + } + + /** + * For more info on pvp heroes API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of pvp hero id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see PvPHero pvp hero info + */ + public void getPvPHeroInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getPvPHeroInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + /** + * For more info on pvp ranks API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see PvPRank PvP rank info + */ + public void getAllPvPRankID(Callback> callback) throws NullPointerException { + gw2API.getAllPvPRankIDs().enqueue(callback); + } + + /** + * For more info on pvp ranks API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of PvP rank id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see PvPRank PvP rank info + */ + public void getPvPRankInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getPvPRankInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + /** + * For more info on pvp season API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see PvPSeason pvp season info + */ + public void getAllPvPSeasonID(Callback> callback) throws NullPointerException { + gw2API.getAllPvPSeasonIDs().enqueue(callback); + } + + /** + * For more info on pvp season API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of pvp season id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see PvPSeason pvp season info + */ + public void getPvPSeasonInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getPvPSeasonInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + /** + * For more info on pvp season API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param api Guild Wars 2 API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @throws GuildWars2Exception invalid api key + * @see PvPLeaderBoard pvp season info + */ + public void getPvPStandingInfo(String api, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, api)); + gw2API.getPvPStandingInfo(api).enqueue(callback); + } + + /** + * For more info on pvp stat API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param api Guild Wars 2 API key + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @throws GuildWars2Exception invalid api key + * @see PvPStat pvp stat info + */ + public void getPvPStatInfo(String api, Callback callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ParamType.API, api)); + gw2API.getPvPStatInfo(api).enqueue(callback); + } + + /** + * For more info on pvp season API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param id Season id + * @param type ladder/legendary/guild + * @param region na/eu + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see PvPLeaderBoard pvp season info + */ + public void getPvPSeasonLeaderBoardInfo(String id, String type, World.Region region, Callback> callback) throws NullPointerException { + gw2API.getPvPSeasonLeaderBoardInfo(id, type, region.name().toLowerCase()).enqueue(callback); + } + + //SYNC +} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Ranks.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Ranks.java deleted file mode 100644 index 40c409c..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Ranks.java +++ /dev/null @@ -1,48 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.pvp; - -import me.xhsun.guildwars2wrapper.GuildWars2; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.pvp.PvPRank; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Ranks extends Request { - protected Ranks(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on pvp ranks API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see PvPRank PvP rank info - */ - public void getAllPvPRankID(Callback> callback) throws NullPointerException { - gw2API.getAllPvPRankIDs().enqueue(callback); - } - - /** - * For more info on pvp ranks API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param ids list of PvP rank id - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception empty ID list - * @throws NullPointerException if given {@link Callback} is empty - * @see PvPRank PvP rank info - */ - public void getPvPRankInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ids)); - gw2API.getPvPRankInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Seasons.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Seasons.java deleted file mode 100644 index 1aca8df..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Seasons.java +++ /dev/null @@ -1,48 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.pvp; - -import me.xhsun.guildwars2wrapper.GuildWars2; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.pvp.PvPSeason; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Seasons extends Request { - protected Seasons(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on pvp season API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see PvPSeason pvp season info - */ - public void getAllPvPSeasonID(Callback> callback) throws NullPointerException { - gw2API.getAllPvPSeasonIDs().enqueue(callback); - } - - /** - * For more info on pvp season API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param ids list of pvp season id(s) - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception empty ID list - * @throws NullPointerException if given {@link Callback} is empty - * @see PvPSeason pvp season info - */ - public void getPvPSeasonInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ids)); - gw2API.getPvPSeasonInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Standings.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Standings.java deleted file mode 100644 index c61360d..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Standings.java +++ /dev/null @@ -1,36 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.pvp; - -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.pvp.PvPLeaderBoard; -import me.xhsun.guildwars2wrapper.model.v2.pvp.PvPStanding; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Standings extends Request { - protected Standings(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on pvp season API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param api Guild Wars 2 API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @throws GuildWars2Exception invalid api key - * @see PvPLeaderBoard pvp season info - */ - public void getPvPStandingInfo(String api, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, api)); - gw2API.getPvPStandingInfo(api).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Stats.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Stats.java deleted file mode 100644 index 38e336d..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/Stats.java +++ /dev/null @@ -1,33 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.pvp; - -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.pvp.PvPStat; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class Stats extends Request { - protected Stats(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on pvp stat API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param api Guild Wars 2 API key - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @throws GuildWars2Exception invalid api key - * @see PvPStat pvp stat info - */ - public void getPvPStatInfo(String api, Callback callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ParamType.API, api)); - gw2API.getPvPStatInfo(api).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/id/Leaderboard.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/id/Leaderboard.java deleted file mode 100644 index 2aa4ef5..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/pvp/id/Leaderboard.java +++ /dev/null @@ -1,35 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.pvp.id; - -import me.xhsun.guildwars2wrapper.model.v2.World; -import me.xhsun.guildwars2wrapper.model.v2.pvp.PvPLeaderBoard; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Leaderboard extends Request { - protected Leaderboard(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on pvp season API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param id Season id - * @param type ladder/legendary/guild - * @param region na/eu - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see PvPLeaderBoard pvp season info - */ - public void getPvPSeasonLeaderBoardInfo(String id, String type, World.Region region, Callback> callback) throws NullPointerException { - gw2API.getPvPSeasonLeaderBoardInfo(id, type, region.name().toLowerCase()).enqueue(callback); - } - - //SYNC -} From cd50611119a610904f41b85c5930b6fd8cae8d31 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 2 Mar 2019 20:10:05 +0100 Subject: [PATCH 43/46] Recipes request async v2 --- .../requests/v2/recipes/Recipes.java | 13 ++++++++ .../requests/v2/recipes/search/Search.java | 32 ------------------- 2 files changed, 13 insertions(+), 32 deletions(-) delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/recipes/search/Search.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/recipes/Recipes.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/recipes/Recipes.java index 8f59f43..59436cb 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/recipes/Recipes.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/recipes/Recipes.java @@ -43,5 +43,18 @@ public void getRecipeInfo(int[] ids, Callback> callback) throws Gui gw2API.getRecipeInfo(processIds(ids)).enqueue(callback); } + /** + * For more info on Recipes search API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see Recipe recipe info + */ + public void searchRecipes(boolean isInput, int id, Callback> callback) throws NullPointerException { + if (isInput) gw2API.searchInputRecipes(Integer.toString(id)).enqueue(callback); + else gw2API.searchOutputRecipes(Integer.toString(id)).enqueue(callback); + } + //SYNC } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/recipes/search/Search.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/recipes/search/Search.java deleted file mode 100644 index 51b90f2..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/recipes/search/Search.java +++ /dev/null @@ -1,32 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.recipes.search; - -import me.xhsun.guildwars2wrapper.model.v2.Recipe; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Search extends Request { - protected Search(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on Recipes search API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see Recipe recipe info - */ - public void searchRecipes(boolean isInput, int id, Callback> callback) throws NullPointerException { - if (isInput) gw2API.searchInputRecipes(Integer.toString(id)).enqueue(callback); - else gw2API.searchOutputRecipes(Integer.toString(id)).enqueue(callback); - } - - //SYNC -} From bc63d5c78f8dc6e78fbed55be165e3e41668c364 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 2 Mar 2019 20:28:02 +0100 Subject: [PATCH 44/46] Stories request async v2 --- .../requests/v2/stories/Stories.java | 28 +++++++++++ .../requests/v2/stories/seasons/Seasons.java | 48 ------------------- 2 files changed, 28 insertions(+), 48 deletions(-) delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/stories/seasons/Seasons.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/stories/Stories.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/stories/Stories.java index 9d12cba..feded10 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/stories/Stories.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/stories/Stories.java @@ -3,6 +3,7 @@ import me.xhsun.guildwars2wrapper.GuildWars2; import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; import me.xhsun.guildwars2wrapper.model.v2.story.Story; +import me.xhsun.guildwars2wrapper.model.v2.story.StorySeason; import me.xhsun.guildwars2wrapper.requests.GuildWars2API; import me.xhsun.guildwars2wrapper.requests.Request; import retrofit2.Call; @@ -44,5 +45,32 @@ public void getStoryInfo(int[] ids, Callback> callback) throws Guild gw2API.getStoryInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); } + /** + * For more info on stories seasons API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see StorySeason story season info + */ + public void getAllStorySeasonID(Callback> callback) throws NullPointerException { + gw2API.getAllStorySeasonIDs().enqueue(callback); + } + + /** + * For more info on stories seasons API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of story season id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see StorySeason story season info + */ + public void getStorySeasonInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getStorySeasonInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + //SYNC } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/stories/seasons/Seasons.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/stories/seasons/Seasons.java deleted file mode 100644 index 4414c47..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/stories/seasons/Seasons.java +++ /dev/null @@ -1,48 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.stories.seasons; - -import me.xhsun.guildwars2wrapper.GuildWars2; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.story.StorySeason; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Seasons extends Request { - protected Seasons(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on stories seasons API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see StorySeason story season info - */ - public void getAllStorySeasonID(Callback> callback) throws NullPointerException { - gw2API.getAllStorySeasonIDs().enqueue(callback); - } - - /** - * For more info on stories seasons API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param ids list of story season id - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception empty ID list - * @throws NullPointerException if given {@link Callback} is empty - * @see StorySeason story season info - */ - public void getStorySeasonInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ids)); - gw2API.getStorySeasonInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); - } - - //SYNC -} From fd4a50590bb9e87214a95ca631912b09097594ab Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 2 Mar 2019 20:28:13 +0100 Subject: [PATCH 45/46] Wvw request async v2 --- .../requests/v2/wvw/Wvw.java | 259 +++++++++++++++++- .../requests/v2/wvw/abilities/Abilities.java | 48 ---- .../requests/v2/wvw/matches/Matches.java | 149 ---------- .../v2/wvw/objectives/Objectives.java | 48 ---- .../requests/v2/wvw/ranks/Ranks.java | 48 ---- .../requests/v2/wvw/upgrades/Upgrades.java | 48 ---- 6 files changed, 258 insertions(+), 342 deletions(-) delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/abilities/Abilities.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/matches/Matches.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/objectives/Objectives.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/ranks/Ranks.java delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/upgrades/Upgrades.java diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/Wvw.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/Wvw.java index ce60c10..019a2cc 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/Wvw.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/Wvw.java @@ -1,4 +1,261 @@ package me.xhsun.guildwars2wrapper.requests.v2.wvw; -public class Wvw { +import me.xhsun.guildwars2wrapper.GuildWars2; +import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; +import me.xhsun.guildwars2wrapper.model.v2.World; +import me.xhsun.guildwars2wrapper.model.v2.wvw.WvWAbility; +import me.xhsun.guildwars2wrapper.model.v2.wvw.WvWObjective; +import me.xhsun.guildwars2wrapper.model.v2.wvw.WvWRank; +import me.xhsun.guildwars2wrapper.model.v2.wvw.WvWUpgrade; +import me.xhsun.guildwars2wrapper.model.v2.wvw.matches.WvWMatchDetail; +import me.xhsun.guildwars2wrapper.model.v2.wvw.matches.WvWMatchOverview; +import me.xhsun.guildwars2wrapper.model.v2.wvw.matches.WvWMatchScore; +import me.xhsun.guildwars2wrapper.model.v2.wvw.matches.WvWMatchStat; +import me.xhsun.guildwars2wrapper.requests.GuildWars2API; +import me.xhsun.guildwars2wrapper.requests.Request; +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; + +import java.util.List; + +public class Wvw extends Request { + protected Wvw(GuildWars2API gw2API) { + super(gw2API); + } + + //ASYNC + /** + * For more info on WvW abilities API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWAbility WvW abilities info + */ + public void getAllWvWAbilityID(Callback> callback) throws NullPointerException { + gw2API.getAllWvWAbilityIDs().enqueue(callback); + } + + /** + * For more info on WvW abilities API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of WvW abilities id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWAbility WvW abilities info + */ + public void getWvWAbilityInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getWvWAbilityInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + /** + * For more info on WvW matches API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWAbility WvW match info + */ + public void getAllWvWMatchID(Callback> callback) throws NullPointerException { + gw2API.getAllWvWMatchIDs().enqueue(callback); + } + + /** + * For more info on WvW matches API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param worldID {@link World#id} + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWMatchDetail WvW match detailed info + */ + public void getWvWMatchDetail(int worldID, Callback callback) throws NullPointerException { + gw2API.getWvWMatchInfoUsingWorld(Integer.toString(worldID)).enqueue(callback); + } + + /** + * For more info on WvW matches API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of wvw match id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @throws GuildWars2Exception empty ID list + * @see WvWMatchDetail WvW match detailed info + */ + public void getWvWMatchDetail(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getWvWMatchInfoUsingID(processIds(ids)).enqueue(callback); + } + + /** + * For more info on WvW matches API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param worldID {@link World#id} + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWMatchOverview WvW match overview info + */ + public void getWvWMatchOverview(int worldID, Callback callback) throws NullPointerException { + gw2API.getWvWMatchOverviewUsingWorld(Integer.toString(worldID)).enqueue(callback); + } + + /** + * For more info on WvW matches API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of wvw match id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @throws GuildWars2Exception empty ID list + * @see WvWMatchOverview WvW match overview info + */ + public void getWvWMatchOverview(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getWvWMatchOverviewUsingID(processIds(ids)).enqueue(callback); + } + + /** + * For more info on WvW matches API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param worldID {@link World#id} + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWMatchScore WvW match score info + */ + public void getWvWMatchScore(int worldID, Callback callback) throws NullPointerException { + gw2API.getWvWMatchScoreUsingWorld(Integer.toString(worldID)).enqueue(callback); + } + + /** + * For more info on WvW matches API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of wvw match id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @throws GuildWars2Exception empty ID list + * @see WvWMatchScore WvW match score info + */ + public void getWvWMatchScore(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getWvWMatchScoreUsingID(processIds(ids)).enqueue(callback); + } + + /** + * For more info on WvW matches API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param worldID {@link World#id} + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWMatchStat WvW match stat info + */ + public void getWvWMatchStat(int worldID, Callback callback) throws NullPointerException { + gw2API.getWvWMatchStatUsingWorld(Integer.toString(worldID)).enqueue(callback); + } + + /** + * For more info on WvW matches API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of wvw match id(s) + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @throws GuildWars2Exception empty ID list + * @see WvWMatchStat WvW match stat info + */ + public void getWvWMatchStat(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getWvWMatchStatUsingID(processIds(ids)).enqueue(callback); + } + + /** + * For more info on WvW objectives API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWObjective WvW objective info + */ + public void getAllWvWObjectiveID(Callback> callback) throws NullPointerException { + gw2API.getAllWvWObjectiveIDs().enqueue(callback); + } + + /** + * For more info on WvW objectives API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of WvW objective id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWObjective WvW objective info + */ + public void getWvWObjectiveInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getWvWObjectiveInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + /** + * For more info on WvW ranks API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWRank WvW rank info + */ + public void getAllWvWRankID(Callback> callback) throws NullPointerException { + gw2API.getAllWvWRankIDs().enqueue(callback); + } + + /** + * For more info on WvW ranks API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of WvW rank id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWRank WvW rank info + */ + public void getWvWRankInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getWvWRankInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + /** + * For more info on WvW upgrades API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWUpgrade WvW upgrade info + */ + public void getAllWvWUpgradeID(Callback> callback) throws NullPointerException { + gw2API.getAllWvWUpgradeIDs().enqueue(callback); + } + + /** + * For more info on WvW upgrades API go here
+ * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions + * + * @param ids list of WvW upgrade id + * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} + * @throws GuildWars2Exception empty ID list + * @throws NullPointerException if given {@link Callback} is empty + * @see WvWUpgrade WvW upgrade info + */ + public void getWvWUpgradeInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { + isParamValid(new ParamChecker(ids)); + gw2API.getWvWUpgradeInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); + } + + //ASYNC } diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/abilities/Abilities.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/abilities/Abilities.java deleted file mode 100644 index 85e1d90..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/abilities/Abilities.java +++ /dev/null @@ -1,48 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.wvw.abilities; - -import me.xhsun.guildwars2wrapper.GuildWars2; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.wvw.WvWAbility; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Abilities extends Request { - protected Abilities(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on WvW abilities API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see WvWAbility WvW abilities info - */ - public void getAllWvWAbilityID(Callback> callback) throws NullPointerException { - gw2API.getAllWvWAbilityIDs().enqueue(callback); - } - - /** - * For more info on WvW abilities API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param ids list of WvW abilities id - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception empty ID list - * @throws NullPointerException if given {@link Callback} is empty - * @see WvWAbility WvW abilities info - */ - public void getWvWAbilityInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ids)); - gw2API.getWvWAbilityInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/matches/Matches.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/matches/Matches.java deleted file mode 100644 index 85ed3aa..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/matches/Matches.java +++ /dev/null @@ -1,149 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.wvw.matches; - -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.World; -import me.xhsun.guildwars2wrapper.model.v2.wvw.WvWAbility; -import me.xhsun.guildwars2wrapper.model.v2.wvw.matches.WvWMatchDetail; -import me.xhsun.guildwars2wrapper.model.v2.wvw.matches.WvWMatchOverview; -import me.xhsun.guildwars2wrapper.model.v2.wvw.matches.WvWMatchScore; -import me.xhsun.guildwars2wrapper.model.v2.wvw.matches.WvWMatchStat; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Matches extends Request { - protected Matches(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on WvW matches API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see WvWAbility WvW match info - */ - public void getAllWvWMatchID(Callback> callback) throws NullPointerException { - gw2API.getAllWvWMatchIDs().enqueue(callback); - } - - /** - * For more info on WvW matches API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param worldID {@link World#id} - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see WvWMatchDetail WvW match detailed info - */ - public void getWvWMatchDetail(int worldID, Callback callback) throws NullPointerException { - gw2API.getWvWMatchInfoUsingWorld(Integer.toString(worldID)).enqueue(callback); - } - - /** - * For more info on WvW matches API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param ids list of wvw match id(s) - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @throws GuildWars2Exception empty ID list - * @see WvWMatchDetail WvW match detailed info - */ - public void getWvWMatchDetail(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ids)); - gw2API.getWvWMatchInfoUsingID(processIds(ids)).enqueue(callback); - } - - /** - * For more info on WvW matches API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param worldID {@link World#id} - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see WvWMatchOverview WvW match overview info - */ - public void getWvWMatchOverview(int worldID, Callback callback) throws NullPointerException { - gw2API.getWvWMatchOverviewUsingWorld(Integer.toString(worldID)).enqueue(callback); - } - - /** - * For more info on WvW matches API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param ids list of wvw match id(s) - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @throws GuildWars2Exception empty ID list - * @see WvWMatchOverview WvW match overview info - */ - public void getWvWMatchOverview(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ids)); - gw2API.getWvWMatchOverviewUsingID(processIds(ids)).enqueue(callback); - } - - /** - * For more info on WvW matches API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param worldID {@link World#id} - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see WvWMatchScore WvW match score info - */ - public void getWvWMatchScore(int worldID, Callback callback) throws NullPointerException { - gw2API.getWvWMatchScoreUsingWorld(Integer.toString(worldID)).enqueue(callback); - } - - /** - * For more info on WvW matches API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param ids list of wvw match id(s) - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @throws GuildWars2Exception empty ID list - * @see WvWMatchScore WvW match score info - */ - public void getWvWMatchScore(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ids)); - gw2API.getWvWMatchScoreUsingID(processIds(ids)).enqueue(callback); - } - - /** - * For more info on WvW matches API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param worldID {@link World#id} - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see WvWMatchStat WvW match stat info - */ - public void getWvWMatchStat(int worldID, Callback callback) throws NullPointerException { - gw2API.getWvWMatchStatUsingWorld(Integer.toString(worldID)).enqueue(callback); - } - - /** - * For more info on WvW matches API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param ids list of wvw match id(s) - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @throws GuildWars2Exception empty ID list - * @see WvWMatchStat WvW match stat info - */ - public void getWvWMatchStat(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ids)); - gw2API.getWvWMatchStatUsingID(processIds(ids)).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/objectives/Objectives.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/objectives/Objectives.java deleted file mode 100644 index f64deb2..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/objectives/Objectives.java +++ /dev/null @@ -1,48 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.wvw.objectives; - -import me.xhsun.guildwars2wrapper.GuildWars2; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.wvw.WvWObjective; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Objectives extends Request { - protected Objectives(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on WvW objectives API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see WvWObjective WvW objective info - */ - public void getAllWvWObjectiveID(Callback> callback) throws NullPointerException { - gw2API.getAllWvWObjectiveIDs().enqueue(callback); - } - - /** - * For more info on WvW objectives API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param ids list of WvW objective id - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception empty ID list - * @throws NullPointerException if given {@link Callback} is empty - * @see WvWObjective WvW objective info - */ - public void getWvWObjectiveInfo(String[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ids)); - gw2API.getWvWObjectiveInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/ranks/Ranks.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/ranks/Ranks.java deleted file mode 100644 index 7f67a55..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/ranks/Ranks.java +++ /dev/null @@ -1,48 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.wvw.ranks; - -import me.xhsun.guildwars2wrapper.GuildWars2; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.wvw.WvWRank; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Ranks extends Request { - protected Ranks(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on WvW ranks API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see WvWRank WvW rank info - */ - public void getAllWvWRankID(Callback> callback) throws NullPointerException { - gw2API.getAllWvWRankIDs().enqueue(callback); - } - - /** - * For more info on WvW ranks API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param ids list of WvW rank id - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception empty ID list - * @throws NullPointerException if given {@link Callback} is empty - * @see WvWRank WvW rank info - */ - public void getWvWRankInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ids)); - gw2API.getWvWRankInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); - } - - //SYNC -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/upgrades/Upgrades.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/upgrades/Upgrades.java deleted file mode 100644 index 5bff9cc..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v2/wvw/upgrades/Upgrades.java +++ /dev/null @@ -1,48 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v2.wvw.upgrades; - -import me.xhsun.guildwars2wrapper.GuildWars2; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v2.wvw.WvWUpgrade; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -import java.util.List; - -public class Upgrades extends Request { - protected Upgrades(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on WvW upgrades API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is empty - * @see WvWUpgrade WvW upgrade info - */ - public void getAllWvWUpgradeID(Callback> callback) throws NullPointerException { - gw2API.getAllWvWUpgradeIDs().enqueue(callback); - } - - /** - * For more info on WvW upgrades API go here
- * Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions - * - * @param ids list of WvW upgrade id - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws GuildWars2Exception empty ID list - * @throws NullPointerException if given {@link Callback} is empty - * @see WvWUpgrade WvW upgrade info - */ - public void getWvWUpgradeInfo(int[] ids, Callback> callback) throws GuildWars2Exception, NullPointerException { - isParamValid(new ParamChecker(ids)); - gw2API.getWvWUpgradeInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback); - } - - //SYNC -} From 4f5affa054bb7a7ffa7c608f8dd6c95da432cd26 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 2 Mar 2019 20:45:41 +0100 Subject: [PATCH 46/46] Wvw request async v1 --- .../requests/v1/wvw/ObjectiveNames.java | 50 ------------------- .../v1/wvw/{Matches.java => Wvw.java} | 28 +++++++++-- 2 files changed, 23 insertions(+), 55 deletions(-) delete mode 100644 src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/ObjectiveNames.java rename src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/{Matches.java => Wvw.java} (70%) diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/ObjectiveNames.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/ObjectiveNames.java deleted file mode 100644 index e2fc3c8..0000000 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/ObjectiveNames.java +++ /dev/null @@ -1,50 +0,0 @@ -package me.xhsun.guildwars2wrapper.requests.v1.wvw; - -import java.io.IOException; -import java.util.List; -import me.xhsun.guildwars2wrapper.GuildWars2; -import me.xhsun.guildwars2wrapper.error.ErrorCode; -import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; -import me.xhsun.guildwars2wrapper.model.v1.SimpleName; -import me.xhsun.guildwars2wrapper.requests.GuildWars2API; -import me.xhsun.guildwars2wrapper.requests.Request; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public class ObjectiveNames extends Request { - - protected ObjectiveNames(GuildWars2API gw2API) { - super(gw2API); - } - - //ASYNC - /** - * For more info on WvW objective names API go here
- * - * @param callback callback that is going to be used for {@link Call#enqueue(Callback)} - * @throws NullPointerException if given {@link Callback} is null - * @see SimpleName objective name - */ - public void getAllWvWObjectiveNames(Callback> callback) throws NullPointerException { - gw2API.getAllWvWObjectiveNames(GuildWars2.lang.getValue()).enqueue(callback); - } - - //SYNC - /** - * For more info on WvW objective API go here
- * - * @return list of names - * @throws GuildWars2Exception see {@link ErrorCode} for detail - * @see SimpleName objective name - */ - public List getAllWvWObjectiveNames() throws GuildWars2Exception { - try { - Response> response = gw2API.getAllWvWObjectiveNames(GuildWars2.lang.getValue()).execute(); - if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); - return response.body(); - } catch (IOException e) { - throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); - } - } -} diff --git a/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/Matches.java b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/Wvw.java similarity index 70% rename from src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/Matches.java rename to src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/Wvw.java index 6c919b9..7f1f776 100644 --- a/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/Matches.java +++ b/src/main/java/me/xhsun/guildwars2wrapper/requests/v1/wvw/Wvw.java @@ -1,7 +1,5 @@ package me.xhsun.guildwars2wrapper.requests.v1.wvw; -import java.io.IOException; -import java.util.List; import me.xhsun.guildwars2wrapper.GuildWars2; import me.xhsun.guildwars2wrapper.error.ErrorCode; import me.xhsun.guildwars2wrapper.error.GuildWars2Exception; @@ -13,9 +11,11 @@ import retrofit2.Callback; import retrofit2.Response; -public class Matches extends Request { +import java.io.IOException; +import java.util.List; - protected Matches(GuildWars2API gw2API) { +public class Wvw extends Request { + protected Wvw(GuildWars2API gw2API) { super(gw2API); } @@ -31,7 +31,6 @@ public void getAllWvWObjectiveNames(Callback> callback) throws gw2API.getAllWvWObjectiveNames(GuildWars2.lang.getValue()).enqueue(callback); } - //SYNC /** * For more info on v1 wvw matches API go here
* @@ -48,4 +47,23 @@ public AllWvWMatchOverview getAllWvWMatchOverview() throws GuildWars2Exception { throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); } } + + /** + * For more info on WvW objective API go here
+ * + * @return list of names + * @throws GuildWars2Exception see {@link ErrorCode} for detail + * @see SimpleName objective name + */ + public List getAllWvWObjectiveNames() throws GuildWars2Exception { + try { + Response> response = gw2API.getAllWvWObjectiveNames(GuildWars2.lang.getValue()).execute(); + if (!response.isSuccessful()) throwError(response.code(), response.errorBody()); + return response.body(); + } catch (IOException e) { + throw new GuildWars2Exception(ErrorCode.Network, "Network Error: " + e.getMessage()); + } + } + + //SYNC }