public abstract class AbstractOptions
extends java.lang.Object
Constructor and Description |
---|
AbstractOptions(java.util.Map<java.lang.String,java.lang.String> options) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
getBoolean(java.lang.String key,
boolean defaultValue)
Parse boolean value from string option.
|
protected <T extends java.lang.Enum<T>> |
getEnum(java.lang.Class<T> enumType,
java.lang.String key,
T defaultValue)
Get string from string option.
|
java.util.Map<java.lang.String,java.lang.String> |
getOptionsMap() |
protected java.lang.String |
getString(java.lang.String key,
java.lang.String defaultValue)
Get string from string option.
|
protected void |
setBoolean(java.lang.String key,
boolean value)
Save boolean value to string option.
|
protected <T extends java.lang.Enum<T>> |
setEnum(java.lang.String key,
T value)
Save string value to string option.
|
protected void |
setString(java.lang.String key,
java.lang.String value)
Save string value to string option.
|
public AbstractOptions(java.util.Map<java.lang.String,java.lang.String> options)
public java.util.Map<java.lang.String,java.lang.String> getOptionsMap()
protected boolean getBoolean(java.lang.String key, boolean defaultValue)
key
- value keydefaultValue
- default value, if value will not be "true" or "false"protected void setBoolean(java.lang.String key, boolean value)
key
- value
- protected java.lang.String getString(java.lang.String key, java.lang.String defaultValue)
key
- value keydefaultValue
- default value, if value will be nullprotected void setString(java.lang.String key, java.lang.String value)
key
- value
- protected <T extends java.lang.Enum<T>> T getEnum(java.lang.Class<T> enumType, java.lang.String key, T defaultValue)
key
- value keydefaultValue
- default value, if value will be nullprotected <T extends java.lang.Enum<T>> void setEnum(java.lang.String key, T value)
key
- value
-