Skip to content

Commit d68aa5c

Browse files
committed
Add JavaDoc and fix metrics
1 parent 8f03b7e commit d68aa5c

4 files changed

Lines changed: 81 additions & 9 deletions

File tree

library/src/main/java/com/proxerme/library/connection/anime/AnimeRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import com.proxerme.library.connection.ProxerRequest;
66

77
/**
8-
* TODO: Describe class
8+
* Base request for all requests in the "anime" API class.
99
*
10-
* @author Ruben Gees
10+
* @author Desnoo
1111
*/
1212
public abstract class AnimeRequest<T> extends ProxerRequest<T> {
1313

library/src/main/java/com/proxerme/library/connection/anime/entity/Stream.java

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import com.squareup.moshi.Json;
1212

1313
/**
14-
* TODO: Describe class
14+
* Entity representing a single streaming option of an anime.
1515
*
1616
* @author Ruben Gees
1717
*/
@@ -50,6 +50,20 @@ public Stream[] newArray(int size) {
5050
@Json(name = "htype")
5151
private String hosterType;
5252

53+
/**
54+
* The constructor.
55+
*
56+
* @param id The id of the stream.
57+
* @param hoster The hoster.
58+
* @param hosterName The name of the hoster.
59+
* @param imageId The image.
60+
* @param uploaderId THe id of the uploader.
61+
* @param uploader The username of the uploader.
62+
* @param time The time this streams was linked.
63+
* @param subgroupId The id of the subgroup if existent
64+
* @param subgroup The name of the subgroup if existent.
65+
* @param hosterType The type of the hoster.
66+
*/
5367
public Stream(@NonNull String id, @NonNull String hoster, @NonNull String hosterName,
5468
@NonNull String imageId, @NonNull String uploaderId, @NonNull String uploader,
5569
long time, @Nullable String subgroupId, @Nullable String subgroup,
@@ -79,53 +93,103 @@ protected Stream(Parcel in) {
7993
this.hosterType = in.readString();
8094
}
8195

96+
/**
97+
* Returns the id.
98+
*
99+
* @return The id.
100+
*/
82101
@NonNull
83102
@Override
84103
public String getId() {
85104
return id;
86105
}
87106

107+
/**
108+
* Returns the hoster.
109+
*
110+
* @return The hoster.
111+
*/
88112
@NonNull
89113
public String getHoster() {
90114
return hoster;
91115
}
92116

117+
/**
118+
* Returns the name of the hoster.
119+
*
120+
* @return The name of the hoster.
121+
*/
93122
@NonNull
94123
public String getHosterName() {
95124
return hosterName;
96125
}
97126

127+
/**
128+
* Returns the image.
129+
*
130+
* @return The image.
131+
*/
98132
@NonNull
99133
@Override
100134
public String getImageId() {
101135
return imageId;
102136
}
103137

138+
/**
139+
* Returns the id of the uploader.
140+
*
141+
* @return The id of the uploader.
142+
*/
104143
@NonNull
105144
public String getUploaderId() {
106145
return uploaderId;
107146
}
108147

148+
/**
149+
* Returns the username of the uploader.
150+
*
151+
* @return The username of the uploader.
152+
*/
109153
@NonNull
110154
public String getUploader() {
111155
return uploader;
112156
}
113157

158+
/**
159+
* Returns the time this stream was linked.
160+
*
161+
* @return The time.
162+
*/
114163
@Override
115164
public long getTime() {
116165
return time;
117166
}
118167

168+
/**
169+
* Returns the id of the subgroup or null if not present.
170+
*
171+
* @return The id.
172+
*/
119173
@Nullable
120174
public String getSubgroupId() {
121175
return subgroupId;
122176
}
123177

178+
/**
179+
* Returns the name of the subgroup or null if not present.
180+
*
181+
* @return The name.
182+
*/
124183
@Nullable
125184
public String getSubgroup() {
126185
return subgroup;
127186
}
128187

188+
/**
189+
* Returns the type of the hoster.
190+
*
191+
* @return The type of the hoster.
192+
*/
129193
@NonNull
130194
public String getHosterType() {
131195
return hosterType;

library/src/main/java/com/proxerme/library/connection/anime/request/LinkRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import okhttp3.ResponseBody;
1515

1616
/**
17-
* TODO: Describe class
17+
* Request for retrieving the link of a stream. This is no direct link.
1818
*
1919
* @author Ruben Gees
2020
*/

library/src/main/java/com/proxerme/library/connection/anime/request/StreamsRequest.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
import okhttp3.ResponseBody;
1818

1919
/**
20-
* TODO: Describe class
20+
* Request for retrieving all streams for a specified episode of an anime (by id) with a specific
21+
* language.
2122
*
2223
* @author Ruben Gees
2324
*/
@@ -34,7 +35,7 @@ public class StreamsRequest extends AnimeRequest<Stream[]> {
3435
private int episode;
3536
private String language;
3637

37-
private boolean withProxerStreams;
38+
private boolean includeProxerStreams;
3839

3940
/**
4041
* The constructor.
@@ -50,8 +51,15 @@ public StreamsRequest(@NonNull String id, @IntRange(from = 1) int episode,
5051
this.language = language;
5152
}
5253

53-
public StreamsRequest withProxerStreams(boolean enable) {
54-
this.withProxerStreams = enable;
54+
/**
55+
* Sets if Proxer-streams should be included. Those require the highest permission level 3.
56+
*
57+
* @param includeProxerStreams True if streams should be included. The request will fail and not
58+
* return if the user has not sufficient rights.
59+
* @return This request.
60+
*/
61+
public StreamsRequest withIncludeProxerStreams(boolean includeProxerStreams) {
62+
this.includeProxerStreams = includeProxerStreams;
5563

5664
return this;
5765
}
@@ -65,7 +73,7 @@ protected ProxerResult<Stream[]> parse(@NonNull Moshi moshi, @NonNull ResponseBo
6573
@NonNull
6674
@Override
6775
protected String getApiEndpoint() {
68-
if (withProxerStreams) {
76+
if (includeProxerStreams) {
6977
return STREAMS_WITH_PROXER;
7078
} else {
7179
return STREAMS;

0 commit comments

Comments
 (0)