Package org.sonar.api.config
Class Settings
- java.lang.Object
-
- org.sonar.api.config.Settings
-
@ServerSide @ComputeEngineSide @ScannerSide @SonarLintSide @Deprecated public abstract class Settings extends java.lang.Object
Deprecated.since 6.5 useConfiguration
. Implementation moved out of the API in 8.3. Only remains minimal interface to make some outdated plugins happy.
-
-
Constructor Summary
Constructors Constructor Description Settings()
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description abstract boolean
getBoolean(java.lang.String key)
Deprecated.Effective value as boolean.abstract java.util.Date
getDate(java.lang.String key)
Deprecated.Effective value asDate
, without time fields.abstract java.util.Date
getDateTime(java.lang.String key)
Deprecated.Effective value asDate
, with time fields.abstract java.lang.Double
getDouble(java.lang.String key)
Deprecated.Effective value asDouble
.abstract java.lang.Float
getFloat(java.lang.String key)
Deprecated.Effective value asFloat
.abstract int
getInt(java.lang.String key)
Deprecated.Effective value asint
.abstract java.util.List<java.lang.String>
getKeysStartingWith(java.lang.String prefix)
Deprecated.abstract long
getLong(java.lang.String key)
Deprecated.Effective value aslong
.abstract java.lang.String
getString(java.lang.String key)
Deprecated.The effective value of the specified property.abstract java.lang.String[]
getStringArray(java.lang.String key)
Deprecated.Value is split by comma and trimmed.abstract java.lang.String[]
getStringArrayBySeparator(java.lang.String key, java.lang.String separator)
Deprecated.Value is split and trimmed.abstract java.lang.String[]
getStringLines(java.lang.String key)
Deprecated.Value is split by carriage returns.abstract boolean
hasKey(java.lang.String key)
Deprecated.
-
-
-
Method Detail
-
hasKey
public abstract boolean hasKey(java.lang.String key)
Deprecated.- Returns:
true
if the property has a non-default value, elsefalse
.
-
getString
@CheckForNull public abstract java.lang.String getString(java.lang.String key)
Deprecated.The effective value of the specified property. Can returnnull
if the property is not set and has no defined default value.If the property is encrypted with a secret key, then the returned value is decrypted.
- Throws:
java.lang.IllegalStateException
- if value is encrypted but fails to be decrypted.
-
getBoolean
public abstract boolean getBoolean(java.lang.String key)
Deprecated.Effective value as boolean. It isfalse
ifgetString(String)
does not return"true"
, even if it's not a boolean representation.- Returns:
true
if the effective value is"true"
, elsefalse
.
-
getInt
public abstract int getInt(java.lang.String key)
Deprecated.Effective value asint
.- Returns:
- the value as
int
. If the property does not have value nor default value, then0
is returned. - Throws:
java.lang.NumberFormatException
- if value is not empty and is not a parsable integer
-
getLong
public abstract long getLong(java.lang.String key)
Deprecated.Effective value aslong
.- Returns:
- the value as
long
. If the property does not have value nor default value, then0L
is returned. - Throws:
java.lang.NumberFormatException
- if value is not empty and is not a parsablelong
-
getDate
@CheckForNull public abstract java.util.Date getDate(java.lang.String key)
Deprecated.Effective value asDate
, without time fields. Format isDateUtils.DATE_FORMAT
.- Returns:
- the value as a
Date
. If the property does not have value nor default value, thennull
is returned. - Throws:
java.lang.RuntimeException
- if value is not empty and is not in accordance withDateUtils.DATE_FORMAT
.
-
getDateTime
@CheckForNull public abstract java.util.Date getDateTime(java.lang.String key)
Deprecated.Effective value asDate
, with time fields. Format isDateUtils.DATETIME_FORMAT
.- Returns:
- the value as a
Date
. If the property does not have value nor default value, thennull
is returned. - Throws:
java.lang.RuntimeException
- if value is not empty and is not in accordance withDateUtils.DATETIME_FORMAT
.
-
getFloat
@CheckForNull public abstract java.lang.Float getFloat(java.lang.String key)
Deprecated.Effective value asFloat
.- Returns:
- the value as
Float
. If the property does not have value nor default value, thennull
is returned. - Throws:
java.lang.NumberFormatException
- if value is not empty and is not a parsable number
-
getDouble
@CheckForNull public abstract java.lang.Double getDouble(java.lang.String key)
Deprecated.Effective value asDouble
.- Returns:
- the value as
Double
. If the property does not have value nor default value, thennull
is returned. - Throws:
java.lang.NumberFormatException
- if value is not empty and is not a parsable number
-
getStringArray
public abstract java.lang.String[] getStringArray(java.lang.String key)
Deprecated.Value is split by comma and trimmed. Never returns null.
Examples :- "one,two,three " -> ["one", "two", "three"]
- " one, two, three " -> ["one", "two", "three"]
- "one, , three" -> ["one", "", "three"]
-
getStringLines
public abstract java.lang.String[] getStringLines(java.lang.String key)
Deprecated.Value is split by carriage returns.- Returns:
- non-null array of lines. The line termination characters are excluded.
- Since:
- 3.2
-
getStringArrayBySeparator
public abstract java.lang.String[] getStringArrayBySeparator(java.lang.String key, java.lang.String separator)
Deprecated.Value is split and trimmed.
-
getKeysStartingWith
public abstract java.util.List<java.lang.String> getKeysStartingWith(java.lang.String prefix)
Deprecated.
-
-