diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2016-08-29 18:44:19 +0200 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2016-08-30 16:09:18 +0200 |
commit | ef892610fe2888078e33b5fd95d9220bd62e3c03 (patch) | |
tree | 68482a74c281ea12658c02064c7f488d46783840 /sonar-plugin-api/src | |
parent | 2e3c74b1b96f5a0475fc7c3482621412aa765192 (diff) | |
download | sonarqube-ef892610fe2888078e33b5fd95d9220bd62e3c03.tar.gz sonarqube-ef892610fe2888078e33b5fd95d9220bd62e3c03.zip |
SONAR-8004 WS settings/set handles property set
Diffstat (limited to 'sonar-plugin-api/src')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Request.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Request.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Request.java index c9d23cb6386..c0b7ec7d618 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Request.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Request.java @@ -38,6 +38,8 @@ import static com.google.common.base.Preconditions.checkArgument; */ public abstract class Request { + private static final String MSG_PARAMETER_MISSING = "The '%s' parameter is missing"; + /** * Returns the name of the HTTP method with which this request was made. Possible * values are GET and POST. Others are not supported. @@ -62,7 +64,7 @@ public abstract class Request { public String mandatoryParam(String key) { String value = param(key); if (value == null) { - throw new IllegalArgumentException(String.format("The '%s' parameter is missing", key)); + throw new IllegalArgumentException(String.format(MSG_PARAMETER_MISSING, key)); } return value; } @@ -104,14 +106,14 @@ public abstract class Request { public List<String> mandatoryParamAsStrings(String key) { List<String> values = paramAsStrings(key); if (values == null) { - throw new IllegalArgumentException(String.format("The '%s' parameter is missing", key)); + throw new IllegalArgumentException(String.format(MSG_PARAMETER_MISSING, key)); } return values; } public List<String> mandatoryMultiParam(String key) { List<String> values = multiParam(key); - checkArgument(!values.isEmpty(), "The '%s' parameter is missing", key); + checkArgument(!values.isEmpty(), MSG_PARAMETER_MISSING, key); return values; } @@ -138,7 +140,7 @@ public abstract class Request { public Part mandatoryParamAsPart(String key) { Part part = paramAsPart(key); - checkArgument(part != null, "The '%s' parameter is missing", key); + checkArgument(part != null, MSG_PARAMETER_MISSING, key); return part; } |