aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-03-10 23:12:07 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2016-03-11 13:50:29 +0100
commitaff4ee97ac9e4382fbd5e4572d9863fdc17be5cf (patch)
tree351beb46dbb5cfbb11aed667b01f6e7f2d4115e4 /sonar-plugin-api
parentfca60c9e1f8276cb01abced1bb67598897117e3f (diff)
downloadsonarqube-aff4ee97ac9e4382fbd5e4572d9863fdc17be5cf.tar.gz
sonarqube-aff4ee97ac9e4382fbd5e4572d9863fdc17be5cf.zip
Complete documentation of org.sonar.api.config.Settings
- missing some @CheckForNull - add javadoc to method getProperties()
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java
index 0b07e962534..3beb0a9aced 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java
@@ -24,6 +24,7 @@ import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
+import javax.annotation.CheckForNull;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.sonar.api.batch.BatchSide;
@@ -118,6 +119,7 @@ public class Settings {
return encryption;
}
+ @CheckForNull
public String getDefaultValue(String key) {
return definitions.getDefaultValue(key);
}
@@ -130,6 +132,7 @@ public class Settings {
return StringUtils.isNotEmpty(getDefaultValue(key));
}
+ @CheckForNull
public String getString(String key) {
String value = getClearString(key);
if (value != null && encryption.isEncrypted(value)) {
@@ -145,6 +148,7 @@ public class Settings {
/**
* Does not decrypt value.
*/
+ @CheckForNull
protected String getClearString(String key) {
doOnGetProperties(key);
String validKey = definitions.validKey(key);
@@ -179,6 +183,7 @@ public class Settings {
return 0L;
}
+ @CheckForNull
public Date getDate(String key) {
String value = getString(key);
if (StringUtils.isNotEmpty(value)) {
@@ -187,6 +192,7 @@ public class Settings {
return null;
}
+ @CheckForNull
public Date getDateTime(String key) {
String value = getString(key);
if (StringUtils.isNotEmpty(value)) {
@@ -195,6 +201,7 @@ public class Settings {
return null;
}
+ @CheckForNull
public Float getFloat(String key) {
String value = getString(key);
if (StringUtils.isNotEmpty(value)) {
@@ -207,6 +214,7 @@ public class Settings {
return null;
}
+ @CheckForNull
public Double getDouble(String key) {
String value = getString(key);
if (StringUtils.isNotEmpty(value)) {
@@ -409,7 +417,8 @@ public class Settings {
}
/**
- * @return immutable properties
+ *
+ * @return immutable copy of properties. Encrypted values are kept and not decrypted.
*/
public Map<String, String> getProperties() {
return ImmutableMap.copyOf(properties);