Package com.avanza.astrix.config
Class BooleanSetting
- java.lang.Object
-
- com.avanza.astrix.config.BooleanSetting
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BooleanSettingcreate(String name, boolean defaultValue)BooleandefaultValue()The default value for this setting.DynamicBooleanPropertygetFrom(DynamicConfig config)Reads this Setting from the givenDynamicConfiginstance.Stringname()The name of this Setting.
-
-
-
Method Detail
-
create
public static BooleanSetting create(String name, boolean defaultValue)
-
getFrom
public DynamicBooleanProperty getFrom(DynamicConfig config)
Description copied from interface:SettingReads this Setting from the givenDynamicConfiginstance. If the DynamicConfig instance does not hold a value for this Setting, then the default value will be returned.- Specified by:
getFromin interfaceSetting<Boolean>- Parameters:
config- DynamicConfig instance to read this setting from- Returns:
- This value of this setting in the given
DynamicConfiginstance, or the default value if the DynamicConfig instance does not contain a value for this Setting
-
name
public String name()
Description copied from interface:SettingThe name of this Setting. Used when reading this Setting from a DynamicConfig instance.
-
defaultValue
public Boolean defaultValue()
Description copied from interface:SettingThe default value for this setting. For settings of primitive types this method returns the boxed version of the given type, and never returns null.- Specified by:
defaultValuein interfaceSetting<Boolean>
-
-