Skip to content

Commit 99b9da3

Browse files
committed
javadoc comments added.
1 parent b2c936c commit 99b9da3

File tree

8 files changed

+297
-30
lines changed

8 files changed

+297
-30
lines changed

library/src/main/java/io/syslogic/github/api/GithubClient.java

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,12 @@ public class GithubClient {
239239
return getService().getWorkflowJobs("token " + token, owner, repo, runId);
240240
}
241241

242-
/** It logs the URL of the call. */
243-
public static void logUrl(@NonNull String tag, @NonNull Call<?> api) {
244-
if (BuildConfig.DEBUG) {Log.w(tag, api.request().url() + "");}
245-
}
246-
247-
/** Note: "bad credentials" means that the provided access-token is invalid. */
242+
/**
243+
* Utility: It parses the error-body of the call.
244+
* Note: "bad credentials" means that the provided access-token is invalid.
245+
* @param tag The desired log-tag.
246+
* @param response Retrofit2 API response.
247+
*/
248248
public static void logError(@NonNull String tag, @NonNull Response<?> response) {
249249
if (BuildConfig.DEBUG && response.errorBody() != null) {
250250
try {
@@ -257,4 +257,13 @@ public static void logError(@NonNull String tag, @NonNull Response<?> response)
257257
}
258258
}
259259
}
260+
261+
/**
262+
* Utility: It logs the URL of the call.
263+
* @param tag The desired log-tag.
264+
* @param api Retrofit2 API request.
265+
*/
266+
public static void logUrl(@NonNull String tag, @NonNull Call<?> api) {
267+
if (BuildConfig.DEBUG) {Log.w(tag, api.request().url() + "");}
268+
}
260269
}

library/src/main/java/io/syslogic/github/api/GithubService.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,14 @@ Call<WorkflowRunsResponse> getWorkflowRuns(
252252
@NonNull @Path(value = "repo") String repo
253253
);
254254

255+
/**
256+
* GitHub Actions: Workflow Run.
257+
* @param token the personal access token.
258+
* @param owner the owner of the repository.
259+
* @param repo the name of the repository.
260+
* @param runId the ID of the workflow run.
261+
* @return Retrofit2 call.
262+
*/
255263
@NonNull
256264
@GET("/repos/{owner}/{repo}/actions/runs/{runId}")
257265
Call<WorkflowRun> getWorkflowRun(
@@ -261,6 +269,14 @@ Call<WorkflowRun> getWorkflowRun(
261269
@NonNull @Path(value = "runId") Long runId
262270
);
263271

272+
/**
273+
* GitHub Actions: Workflow Run Jobs.
274+
* @param token the personal access token.
275+
* @param owner the owner of the repository.
276+
* @param repo the name of the repository.
277+
* @param runId the ID of the workflow run.
278+
* @return Retrofit2 call.
279+
*/
264280
@NonNull
265281
@GET("/repos/{owner}/{repo}/actions/runs/{runId}/jobs")
266282
Call<WorkflowJobsResponse> getWorkflowJobs(

library/src/main/java/io/syslogic/github/api/model/Branch.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,35 @@ public class Branch {
1717
@SerializedName("commit")
1818
private Commit commit;
1919

20-
/** Setter for name. */
20+
/**
21+
* Setter for name.
22+
* @param value the name of the branch.
23+
*/
2124
public void setName(@NonNull String value) {
2225
this.name = value;
2326
}
2427

25-
/** Setter for commit. */
28+
/**
29+
* Setter for commit.
30+
* @param item the commit to set.
31+
*/
2632
public void setCommit(@NonNull Commit item) {
2733
this.commit = item;
2834
}
2935

30-
/** Getter for commit. */
36+
/**
37+
* Getter for commit.
38+
* @return instance of {@link Commit}.
39+
*/
3140
@NonNull
3241
public Commit getCommit() {
3342
return this.commit;
3443
}
3544

36-
/** Getter for name. */
45+
/**
46+
* Getter for name.
47+
* @return the name of the branch.
48+
*/
3749
@NonNull
3850
public String getName() {
3951
return this.name;

library/src/main/java/io/syslogic/github/api/model/Commit.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,35 @@ public class Commit {
1717
@SerializedName("url")
1818
private String url;
1919

20-
/** Setter for sha. */
20+
/**
21+
* Setter for sha.
22+
* @param value the sha of the commit.
23+
*/
2124
public void setSha(@NonNull String value) {
2225
this.sha = value;
2326
}
2427

25-
/** Setter for url. */
28+
/**
29+
* Setter for url.
30+
* @param value the url of the commit.
31+
*/
2632
public void setUrl(@NonNull String value) {
2733
this.url = value;
2834
}
2935

30-
/** Getter for sha. */
36+
/**
37+
* Getter for sha.
38+
* @return the sha of the commit.
39+
*/
3140
@NonNull
3241
public String getSha() {
3342
return this.sha;
3443
}
3544

36-
/** Getter for url. */
45+
/**
46+
* Getter for url.
47+
* @return the url of the commit.
48+
*/
3749
@NonNull
3850
public String getUrl() {
3951
return this.url;

library/src/main/java/io/syslogic/github/api/model/License.java

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,56 +36,104 @@ public class License {
3636
@SerializedName("url")
3737
private String url;
3838

39+
/**
40+
* Getter for id.
41+
* @return the id of the license.
42+
*/
3943
@NonNull
4044
public Long getId() {
4145
return this.id;
4246
}
4347

48+
/**
49+
* Getter for nodeId.
50+
* @return the nodeId of the license.
51+
*/
4452
@NonNull
4553
public String getNodeId() {
4654
return this.nodeId;
4755
}
4856

57+
/**
58+
* Getter for key.
59+
* @return the key of the license.
60+
*/
4961
@NonNull
5062
public String getKey() {
5163
return this.key;
5264
}
5365

66+
/**
67+
* Getter for spdxId.
68+
* @return the spdxId of the license.
69+
*/
5470
@NonNull
5571
public String getSpdxId() {
5672
return this.spdxId;
5773
}
5874

75+
/**
76+
* Getter for title.
77+
* @return the title of the license.
78+
*/
5979
@NonNull
6080
public String getTitle() {
6181
return this.title;
6282
}
6383

84+
/**
85+
* Getter for url.
86+
* @return the url of the license.
87+
*/
6488
@NonNull
6589
public String getUrl() {
6690
return this.url;
6791
}
6892

93+
/**
94+
* Setter for id.
95+
* @param value the id of the license.
96+
*/
6997
public void setId(@NonNull Long value) {
7098
this.id = value;
7199
}
72100

101+
/**
102+
* Setter for nodeId.
103+
* @param value the nodeId of the license.
104+
*/
73105
public void setNodeId(@NonNull String value) {
74106
this.nodeId = value;
75107
}
76108

109+
/**
110+
* Setter for key.
111+
* @param value the key of the license.
112+
*/
77113
public void setKey(@NonNull String value) {
78114
this.key = value;
79115
}
80116

117+
/**
118+
* Setter for spdxId.
119+
* @param value the spdxId of the license.
120+
*/
81121
public void setSpdxId(@NonNull String value) {
82122
this.spdxId = value;
83123
}
84124

125+
/**
126+
* Setter for title.
127+
* @param value the title of the license.
128+
*/
85129
public void setTitle(@NonNull String value) {
86130
this.title = value;
87131
}
88132

133+
/**
134+
* Setter for url.
135+
* @param value the url of the license.
136+
*/
89137
public void setUrl(@NonNull String value) {
90138
this.url = value;
91139
}

0 commit comments

Comments
 (0)