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) booleangetBoolean(String key, boolean defaultValue) doubleintlong
-
Method Details
-
getString
- Parameters:
key- of the setting to lookup- Returns:
- the
Stringcontained 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
Stringcontained 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
Booleancontained 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
booleancontained under this setting key, if the String value equals "true", or the default
-
getInt
- Parameters:
key- of the setting to lookup- Returns:
- the
Integercontained 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
intcontained 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
Longcontained 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
longcontained 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
Doublecontained 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
doublecontained 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
-