public class MediaProviderConfig extends Object
Constructor and Description |
---|
MediaProviderConfig(MediaProviderInfo mpi) |
Modifier and Type | Method and Description |
---|---|
void |
addBoolean(String key,
boolean defaultValue) |
void |
addSelect(String key,
String[] possibleValues,
String defaultValue) |
void |
addSelectIndex(String key,
String[] possibleValues,
String defaultValue) |
void |
addText(String key,
String defaultValue) |
void |
addText(String key,
String defaultValue,
boolean encrypt) |
Map<String,String> |
getConfigKeyValuePairs()
convenient method, to return a key=value map of all config entries
|
MediaProviderConfigObject |
getConfigObject(String key)
returns a config object (or an empty one if not found)
|
Map<String,MediaProviderConfigObject> |
getConfigObjects() |
String |
getValue(String key)
gets the config value as string (or the default)
You might want to parse it to boolean if it is true|false You might get a number if it was setup to return the index might return an empty string! |
Boolean |
getValueAsBool(String key)
If you know that this key is a boolean, use that :)
will return NULL if it cannot be parsed as boolean |
Integer |
getValueIndex(String key)
gets the config value as index
works only on select boxes might return NULL if not found/parseable |
boolean |
hasConfig()
indicate whether a config is available or not
|
void |
load()
loads config from settings file
Should be called right after defining the configuration objects! |
void |
loadFromDir(String folder)
Deprecated.
|
void |
save() |
void |
saveToDir(String folder)
Deprecated.
|
void |
setValue(String key,
boolean value) |
void |
setValue(String key,
String value) |
String |
toString() |
public MediaProviderConfig(MediaProviderInfo mpi)
public void load()
@Deprecated public void loadFromDir(String folder)
public void save()
@Deprecated public void saveToDir(String folder)
public boolean hasConfig()
public Map<String,MediaProviderConfigObject> getConfigObjects()
public Map<String,String> getConfigKeyValuePairs()
public MediaProviderConfigObject getConfigObject(String key)
key
- public String getValue(String key)
key
- public Integer getValueIndex(String key)
key
- public Boolean getValueAsBool(String key)
key
- public void setValue(String key, boolean value)
public void addBoolean(String key, boolean defaultValue)
Copyright © 2012–2019 tinyMediaManager. All rights reserved.