From 5cc27f5560c05befdee8cbd6db24fc0eaab87cb3 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Fri, 7 Apr 2023 15:21:53 -0700 Subject: Added Javadoc comments --- src/main/java/com/pina/Holodex.java | 67 ++++++++++++++++- src/main/java/com/pina/HolodexException.java | 14 ++++ src/main/java/com/pina/HolodexService.java | 87 ++++++++++++++++++++++ src/main/java/com/pina/datatypes/Channel.java | 3 + src/main/java/com/pina/datatypes/Comment.java | 3 + .../java/com/pina/datatypes/SimpleChannel.java | 3 + src/main/java/com/pina/datatypes/SimpleVideo.java | 3 + src/main/java/com/pina/datatypes/Video.java | 3 + .../java/com/pina/query/ChannelQueryBuilder.java | 6 +- .../com/pina/query/VideoByVideoIdQueryBuilder.java | 7 +- .../java/com/pina/query/VideoQueryBuilder.java | 7 +- .../pina/query/VideosByChannelIDQueryBuilder.java | 6 +- 12 files changed, 194 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/main/java/com/pina/Holodex.java b/src/main/java/com/pina/Holodex.java index 931021f..9e7ef39 100644 --- a/src/main/java/com/pina/Holodex.java +++ b/src/main/java/com/pina/Holodex.java @@ -17,15 +17,28 @@ import retrofit2.converter.jackson.JacksonConverterFactory; import java.io.IOException; import java.util.List; +/** + * The class for interacting with the Holodex API + */ public class Holodex { private HolodexService service; + /** + * Instantiates a new Holodex with the default base url + * + * @param apiKey the api key + */ public Holodex(String apiKey) { initializeHolodexService(apiKey, "https://holodex.net"); } + /** + * Instantiates a new Holodex with a custom base url + * + * @param apiKey the api key + * @param baseUrl the base url + */ public Holodex(String apiKey, String baseUrl) { - // purely for unit testing initializeHolodexService(apiKey, baseUrl); } @@ -47,6 +60,13 @@ public class Holodex { service = retrofit.create(HolodexService.class); } + /** + * Gets a list of upcoming and/or live SimpleVideos matching the VideoQueryBuilder attributes + * + * @param queryBuilder the query builder + * @return A list of upcoming and/or live SimpleVideos + * @throws HolodexException the holodex exception + */ public List getLiveAndUpcomingVideos(VideoQueryBuilder queryBuilder) throws HolodexException { Call> call = service.getLiveVideos(queryBuilder.getChannelId(), queryBuilder.getId(), queryBuilder.getInclude(), queryBuilder.getLang(), @@ -59,6 +79,13 @@ public class Holodex { return executeCall(call); } + /** + * Gets a list of videos matching the VideoQueryBuilder attributes + * + * @param queryBuilder the query builder + * @return list of videos + * @throws HolodexException the holodex exception + */ public List