diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-11-12 11:20:43 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-11-17 13:40:59 +0100 |
commit | 3c3d60d4e50ce70d7038bf1d2a71e98effc3d458 (patch) | |
tree | d8d9359140407fbeb553dd3c658c64c4fe12c92d /sonar-ws | |
parent | 614a6496873c9b8f2149c4ee17a3e738cea1f470 (diff) | |
download | sonarqube-3c3d60d4e50ce70d7038bf1d2a71e98effc3d458.tar.gz sonarqube-3c3d60d4e50ce70d7038bf1d2a71e98effc3d458.zip |
SONAR-6947 Improve XXXWsRequest contracts
Diffstat (limited to 'sonar-ws')
3 files changed, 14 insertions, 8 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupToTemplateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupToTemplateWsRequest.java index 2fff2a6928f..3cd273d0903 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupToTemplateWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupToTemplateWsRequest.java @@ -23,6 +23,8 @@ package org.sonarqube.ws.client.permission; import javax.annotation.CheckForNull; import javax.annotation.Nullable; +import static java.util.Objects.requireNonNull; + public class AddGroupToTemplateWsRequest { private String groupId; private String groupName; @@ -55,7 +57,7 @@ public class AddGroupToTemplateWsRequest { } public AddGroupToTemplateWsRequest setPermission(String permission) { - this.permission = permission; + this.permission = requireNonNull(permission, "permission must not be null"); return this; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupWsRequest.java index 975580862fb..8a7ddbd00e2 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/AddGroupWsRequest.java @@ -23,9 +23,11 @@ package org.sonarqube.ws.client.permission; import javax.annotation.CheckForNull; import javax.annotation.Nullable; +import static java.util.Objects.requireNonNull; + public class AddGroupWsRequest { private String permission; - private Long groupId; + private String groupId; private String groupName; private String projectId; private String projectKey; @@ -35,16 +37,16 @@ public class AddGroupWsRequest { } public AddGroupWsRequest setPermission(String permission) { - this.permission = permission; + this.permission = requireNonNull(permission, "permission must not be null"); return this; } @CheckForNull - public Long getGroupId() { + public String getGroupId() { return groupId; } - public AddGroupWsRequest setGroupId(@Nullable Long groupId) { + public AddGroupWsRequest setGroupId(@Nullable String groupId) { this.groupId = groupId; return this; } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/GroupsWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/GroupsWsRequest.java index 535ed11ce37..35690aaf80e 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/GroupsWsRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/permission/GroupsWsRequest.java @@ -22,6 +22,8 @@ package org.sonarqube.ws.client.permission; import javax.annotation.CheckForNull; import javax.annotation.Nullable; +import static java.util.Objects.requireNonNull; + public class GroupsWsRequest { private String permission; private String projectId; @@ -36,7 +38,7 @@ public class GroupsWsRequest { } public GroupsWsRequest setPermission(String permission) { - this.permission = permission; + this.permission = requireNonNull(permission, "permission must not be null"); return this; } @@ -45,7 +47,7 @@ public class GroupsWsRequest { return projectId; } - public GroupsWsRequest setProjectId(String projectId) { + public GroupsWsRequest setProjectId(@Nullable String projectId) { this.projectId = projectId; return this; } @@ -93,7 +95,7 @@ public class GroupsWsRequest { } public GroupsWsRequest setSelected(String selected) { - this.selected = selected; + this.selected = requireNonNull(selected, "selected must not be null"); return this; } } |