Skip to content

Use "Boolean" instead of "boolean" for optional parameters #1212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gitlab4j-api/src/main/java/org/gitlab4j/api/NotesApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ public Note getMergeRequestNote(Object projectIdOrPath, Long mergeRequestIid, Lo
* @throws GitLabApiException if any exception occurs
*/
public Note createMergeRequestNote(
Object projectIdOrPath, Long mergeRequestIid, String body, Date createdAt, boolean internal)
Object projectIdOrPath, Long mergeRequestIid, String body, Date createdAt, Boolean internal)
throws GitLabApiException {
GitLabApiForm formData =
new GitLabApiForm().withParam("body", body, true).withParam("internal", internal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,8 @@ public File getRepositoryArchive(
* Compare branches, tags or commits. This can be accessed without authentication
* if the repository is publicly accessible.
*
* <pre><code>GitLab Endpoint: GET /projects/:id/repository/compare</code></pre>
*
* @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance
* @param from the commit SHA or branch name
* @param to the commit SHA or branch name
Expand All @@ -912,7 +914,7 @@ public File getRepositoryArchive(
* @return a CompareResults containing the results of the comparison
* @throws GitLabApiException if any exception occurs
*/
public CompareResults compare(Object projectIdOrPath, String from, String to, boolean straight)
public CompareResults compare(Object projectIdOrPath, String from, String to, Boolean straight)
throws GitLabApiException {
Form formData = new GitLabApiForm()
.withParam("from", from, true)
Expand Down
4 changes: 2 additions & 2 deletions gitlab4j-api/src/main/java/org/gitlab4j/api/UserApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ public Stream<User> findUsersStream(String emailOrUsername) throws GitLabApiExce
* @param projectsLimit the maximum number of project
* @return created User instance
* @throws GitLabApiException if any exception occurs
* @deprecated Will be removed in version 6.0, replaced by {@link #createUser(User, CharSequence, boolean)}
* @deprecated Will be removed in version 6.0, replaced by {@link #createUser(User, CharSequence, Boolean)}
*/
@Deprecated
public User createUser(User user, CharSequence password, Integer projectsLimit) throws GitLabApiException {
Expand Down Expand Up @@ -586,7 +586,7 @@ public User createUser(User user, CharSequence password, Integer projectsLimit)
* @return created User instance
* @throws GitLabApiException if any exception occurs
*/
public User createUser(User user, CharSequence password, boolean resetPassword) throws GitLabApiException {
public User createUser(User user, CharSequence password, Boolean resetPassword) throws GitLabApiException {
Form formData = userToForm(user, null, password, resetPassword, true);
Response response = post(Response.Status.CREATED, formData, "users");
return (response.readEntity(User.class));
Expand Down
13 changes: 8 additions & 5 deletions gitlab4j-api/src/main/java/org/gitlab4j/api/WikisApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public Stream<WikiPage> getPagesStream(Object projectIdOrPath) throws GitLabApiE
* @param perPage the number of wiki-pages per page
* @return a list of pages in project's wiki for the specified range
* @throws GitLabApiException if any exception occurs
* @deprecated Will be removed in a future release, use {@link #getPages(Object, boolean, int)}
* @deprecated Will be removed in a future release, use {@link #getPages(Object, Boolean, int)}
*/
public List<WikiPage> getPages(Object projectIdOrPath, int page, int perPage) throws GitLabApiException {
Response response = get(
Expand All @@ -118,7 +118,7 @@ public List<WikiPage> getPages(Object projectIdOrPath, int page, int perPage) th
* @return a List of pages in project's wiki for the specified range
* @throws GitLabApiException if any exception occurs
*/
public List<WikiPage> getPages(Object projectIdOrPath, boolean withContent) throws GitLabApiException {
public List<WikiPage> getPages(Object projectIdOrPath, Boolean withContent) throws GitLabApiException {
return (getPages(projectIdOrPath, withContent, getDefaultPerPage()).all());
}

Expand All @@ -133,9 +133,12 @@ public List<WikiPage> getPages(Object projectIdOrPath, boolean withContent) thro
* @return a Pager of pages in project's wiki for the specified range
* @throws GitLabApiException if any exception occurs
*/
public Pager<WikiPage> getPages(Object projectIdOrPath, boolean withContent, int itemsPerPage)
public Pager<WikiPage> getPages(Object projectIdOrPath, Boolean withContent, int itemsPerPage)
throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm().withParam("with_content", (withContent ? 1 : 0));
GitLabApiForm formData = new GitLabApiForm();
if (withContent != null) {
formData.withParam("with_content", (withContent.booleanValue() ? 1 : 0));
}
return (new Pager<WikiPage>(
this,
WikiPage.class,
Expand All @@ -156,7 +159,7 @@ public Pager<WikiPage> getPages(Object projectIdOrPath, boolean withContent, int
* @return a Stream of pages in project's wiki for the specified range
* @throws GitLabApiException if any exception occurs
*/
public Stream<WikiPage> getPagesStream(Object projectIdOrPath, boolean withContent) throws GitLabApiException {
public Stream<WikiPage> getPagesStream(Object projectIdOrPath, Boolean withContent) throws GitLabApiException {
return (getPages(projectIdOrPath, withContent, getDefaultPerPage()).stream());
}

Expand Down
Loading