public interface

Settings

com.atlassian.bitbucket.setting.Settings

Class Overview

A typed container for a generic map of settings.

Summary

Public Methods
Map<String, Object> asMap()
boolean getBoolean(String key, boolean defaultValue)
@Nullable Boolean getBoolean(String key)
double getDouble(String key, double defaultValue)
@Nullable Double getDouble(String key)
int getInt(String key, int defaultValue)
@Nullable Integer getInt(String key)
@Nullable Long getLong(String key)
long getLong(String key, long defaultValue)
@Nonnull String getString(String key, String defaultValue)
@Nullable String getString(String key)

Public Methods

public Map<String, Object> asMap ()

Returns
  • a map representation of the settings

public boolean getBoolean (String key, boolean defaultValue)

Parameters
key of the setting to lookup
defaultValue 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

@Nullable public Boolean getBoolean (String key)

Parameters
key of the setting to lookup
Returns
  • the Boolean contained under this setting key, if the String value equals "true", or null

public double getDouble (String key, double defaultValue)

Parameters
key of the setting to lookup
defaultValue 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

@Nullable public Double getDouble (String key)

Parameters
key of the setting to lookup
Returns
  • the Double contained under this setting key, a parsed representation of the String, or null
Throws
NumberFormatException if the resulting string is not a legal double

public int getInt (String key, int defaultValue)

Parameters
key of the setting to lookup
defaultValue 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

@Nullable public Integer getInt (String key)

Parameters
key of the setting to lookup
Returns
  • the Integer contained under this setting key, a parsed representation of the String, or null
Throws
NumberFormatException if the resulting string is not a legal int

@Nullable public Long getLong (String key)

Parameters
key of the setting to lookup
Returns
  • the Long contained under this setting key, a parsed representation of the String, or null
Throws
NumberFormatException if the resulting string is not a legal long

public long getLong (String key, long defaultValue)

Parameters
key of the setting to lookup
defaultValue 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

@Nonnull public String getString (String key, String defaultValue)

Parameters
key of the setting to lookup
defaultValue 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 a String

@Nullable public String getString (String key)

Parameters
key of the setting to lookup
Returns
  • the String contained under this setting key or null
Throws
ClassCastException is the underlying setting is not a String