Skip to content

Commit 7f6aa16

Browse files
authored
Use "Boolean" instead of "boolean" for optional parameters (#1212)
1 parent 6722a5b commit 7f6aa16

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

Diff for: gitlab4j-api/src/main/java/org/gitlab4j/api/NotesApi.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ public Note getMergeRequestNote(Object projectIdOrPath, Long mergeRequestIid, Lo
455455
* @throws GitLabApiException if any exception occurs
456456
*/
457457
public Note createMergeRequestNote(
458-
Object projectIdOrPath, Long mergeRequestIid, String body, Date createdAt, boolean internal)
458+
Object projectIdOrPath, Long mergeRequestIid, String body, Date createdAt, Boolean internal)
459459
throws GitLabApiException {
460460
GitLabApiForm formData =
461461
new GitLabApiForm().withParam("body", body, true).withParam("internal", internal);

Diff for: gitlab4j-api/src/main/java/org/gitlab4j/api/RepositoryApi.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,8 @@ public File getRepositoryArchive(
904904
* Compare branches, tags or commits. This can be accessed without authentication
905905
* if the repository is publicly accessible.
906906
*
907+
* <pre><code>GitLab Endpoint: GET /projects/:id/repository/compare</code></pre>
908+
*
907909
* @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance
908910
* @param from the commit SHA or branch name
909911
* @param to the commit SHA or branch name
@@ -912,7 +914,7 @@ public File getRepositoryArchive(
912914
* @return a CompareResults containing the results of the comparison
913915
* @throws GitLabApiException if any exception occurs
914916
*/
915-
public CompareResults compare(Object projectIdOrPath, String from, String to, boolean straight)
917+
public CompareResults compare(Object projectIdOrPath, String from, String to, Boolean straight)
916918
throws GitLabApiException {
917919
Form formData = new GitLabApiForm()
918920
.withParam("from", from, true)

Diff for: gitlab4j-api/src/main/java/org/gitlab4j/api/UserApi.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ public Stream<User> findUsersStream(String emailOrUsername) throws GitLabApiExce
545545
* @param projectsLimit the maximum number of project
546546
* @return created User instance
547547
* @throws GitLabApiException if any exception occurs
548-
* @deprecated Will be removed in version 6.0, replaced by {@link #createUser(User, CharSequence, boolean)}
548+
* @deprecated Will be removed in version 6.0, replaced by {@link #createUser(User, CharSequence, Boolean)}
549549
*/
550550
@Deprecated
551551
public User createUser(User user, CharSequence password, Integer projectsLimit) throws GitLabApiException {
@@ -586,7 +586,7 @@ public User createUser(User user, CharSequence password, Integer projectsLimit)
586586
* @return created User instance
587587
* @throws GitLabApiException if any exception occurs
588588
*/
589-
public User createUser(User user, CharSequence password, boolean resetPassword) throws GitLabApiException {
589+
public User createUser(User user, CharSequence password, Boolean resetPassword) throws GitLabApiException {
590590
Form formData = userToForm(user, null, password, resetPassword, true);
591591
Response response = post(Response.Status.CREATED, formData, "users");
592592
return (response.readEntity(User.class));

Diff for: gitlab4j-api/src/main/java/org/gitlab4j/api/WikisApi.java

+8-5
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public Stream<WikiPage> getPagesStream(Object projectIdOrPath) throws GitLabApiE
9696
* @param perPage the number of wiki-pages per page
9797
* @return a list of pages in project's wiki for the specified range
9898
* @throws GitLabApiException if any exception occurs
99-
* @deprecated Will be removed in a future release, use {@link #getPages(Object, boolean, int)}
99+
* @deprecated Will be removed in a future release, use {@link #getPages(Object, Boolean, int)}
100100
*/
101101
public List<WikiPage> getPages(Object projectIdOrPath, int page, int perPage) throws GitLabApiException {
102102
Response response = get(
@@ -118,7 +118,7 @@ public List<WikiPage> getPages(Object projectIdOrPath, int page, int perPage) th
118118
* @return a List of pages in project's wiki for the specified range
119119
* @throws GitLabApiException if any exception occurs
120120
*/
121-
public List<WikiPage> getPages(Object projectIdOrPath, boolean withContent) throws GitLabApiException {
121+
public List<WikiPage> getPages(Object projectIdOrPath, Boolean withContent) throws GitLabApiException {
122122
return (getPages(projectIdOrPath, withContent, getDefaultPerPage()).all());
123123
}
124124

@@ -133,9 +133,12 @@ public List<WikiPage> getPages(Object projectIdOrPath, boolean withContent) thro
133133
* @return a Pager of pages in project's wiki for the specified range
134134
* @throws GitLabApiException if any exception occurs
135135
*/
136-
public Pager<WikiPage> getPages(Object projectIdOrPath, boolean withContent, int itemsPerPage)
136+
public Pager<WikiPage> getPages(Object projectIdOrPath, Boolean withContent, int itemsPerPage)
137137
throws GitLabApiException {
138-
GitLabApiForm formData = new GitLabApiForm().withParam("with_content", (withContent ? 1 : 0));
138+
GitLabApiForm formData = new GitLabApiForm();
139+
if (withContent != null) {
140+
formData.withParam("with_content", (withContent.booleanValue() ? 1 : 0));
141+
}
139142
return (new Pager<WikiPage>(
140143
this,
141144
WikiPage.class,
@@ -156,7 +159,7 @@ public Pager<WikiPage> getPages(Object projectIdOrPath, boolean withContent, int
156159
* @return a Stream of pages in project's wiki for the specified range
157160
* @throws GitLabApiException if any exception occurs
158161
*/
159-
public Stream<WikiPage> getPagesStream(Object projectIdOrPath, boolean withContent) throws GitLabApiException {
162+
public Stream<WikiPage> getPagesStream(Object projectIdOrPath, Boolean withContent) throws GitLabApiException {
160163
return (getPages(projectIdOrPath, withContent, getDefaultPerPage()).stream());
161164
}
162165

0 commit comments

Comments
 (0)