From 51ebbee71fb508bc7c95807e06daef12422ccbcd Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Wed, 5 Apr 2023 00:21:57 -0700 Subject: Make classes return itself to allow for concatenated object creation --- .idea/encodings.xml | 7 ++++ src/main/java/App.java | 43 ++++++++++------------ .../java/com/pina/query/ChannelQueryBuilder.java | 21 +++++++---- .../java/com/pina/query/VideoQueryBuilder.java | 10 +++-- 4 files changed, 48 insertions(+), 33 deletions(-) create mode 100644 .idea/encodings.xml diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/main/java/App.java b/src/main/java/App.java index 6a5fc48..05f4856 100644 --- a/src/main/java/App.java +++ b/src/main/java/App.java @@ -4,6 +4,7 @@ import com.pina.datatypes.Channel; import com.pina.datatypes.Video; import com.pina.query.ChannelQueryBuilder; import com.pina.query.LiveVideoQueryBuilder; +import com.pina.query.VideoQueryBuilder; import java.util.List; @@ -11,35 +12,31 @@ public class App { public static void main( String[] args ) { - Holodex holodex = new Holodex("b33eda39-dfb0-4337-9c8a-49cd8e69f5d5"); try { - ChannelQueryBuilder query = new ChannelQueryBuilder(); - query.setOrg("Hololive"); - List channels = holodex.getChannels(query); - System.out.println("The Members of Hololive are:"); - for (Channel channel : channels) { - System.out.println(channel.name + " (" + channel.id + ")"); - } - System.out.println("\n"); - Channel channel = holodex.getChannel("UC1DCedRgGHBdm81E1llLhOQ"); - System.out.println(channel.name+"'s English name is " + channel.english_name); - System.out.println(channel.name+" is a "+channel.type); + Holodex holodex = new Holodex("b33eda39-dfb0-4337-9c8a-49cd8e69f5d5"); + Channel channel = holodex.getChannel("UC4WvIIAo89_AzGUh1AZ6Dkg"); + System.out.println(channel.name + " is a member of " + channel.org + " and has " + channel.suborg + " as a suborg"); - LiveVideoQueryBuilder liveQuery = new LiveVideoQueryBuilder(); - liveQuery.setChannelId("UCkngxfPbmGyGl_RIq4FA3MQ"); - liveQuery.setStatus("upcoming"); - List