Package com.atlassian.bitbucket.setting
Interface Settings
public interface Settings
A typed container for a generic map of settings.
-
Method Summary
Modifier and TypeMethodDescriptionasMap()
getBoolean
(String key) boolean
getBoolean
(String key, boolean defaultValue) double
int
long
-
Method Details
-
getString
- Parameters:
key
- of the setting to lookup- Returns:
- the
String
contained under this setting key ornull
- Throws:
ClassCastException
- is the underlying setting is not aString
-
getString
- Parameters:
key
- of the setting to lookupdefaultValue
- the default value if the value isn't present- Returns:
- the
String
contained under this setting key or the default - Throws:
ClassCastException
- is the underlying setting is not aString
-
getBoolean
- Parameters:
key
- of the setting to lookup- Returns:
- the
Boolean
contained under this setting key, if the String value equals "true", ornull
-
getBoolean
- Parameters:
key
- of the setting to lookupdefaultValue
- the default value if the value isn't present- Returns:
- the
boolean
contained under this setting key, if the String value equals "true", or the default
-
getInt
- Parameters:
key
- of the setting to lookup- Returns:
- the
Integer
contained under this setting key, a parsed representation of the String, ornull
- Throws:
NumberFormatException
- if the resulting string is not a legal int
-
getInt
- Parameters:
key
- of the setting to lookupdefaultValue
- the default value if the value isn't present- Returns:
- the
int
contained under this setting key, a parsed representation of the String, or the default - Throws:
NumberFormatException
- if the resulting string is not a legal int
-
getLong
- Parameters:
key
- of the setting to lookup- Returns:
- the
Long
contained under this setting key, a parsed representation of the String, ornull
- Throws:
NumberFormatException
- if the resulting string is not a legal long
-
getLong
- Parameters:
key
- of the setting to lookupdefaultValue
- the default value if the value isn't present- Returns:
- the
long
contained under this setting key, a parsed representation of the String, or the default - Throws:
NumberFormatException
- if the resulting string is not a legal long
-
getDouble
- Parameters:
key
- of the setting to lookup- Returns:
- the
Double
contained under this setting key, a parsed representation of the String, ornull
- Throws:
NumberFormatException
- if the resulting string is not a legal double
-
getDouble
- Parameters:
key
- of the setting to lookupdefaultValue
- the default value if the value isn't present- Returns:
- the
double
contained under this setting key, a parsed representation of the String, or the default - Throws:
NumberFormatException
- if the resulting string is not a legal double
-
asMap
- Returns:
- a map representation of the settings
-