Interface PluginSettings
public interface PluginSettings
Plugin settings (hierarchical key-value store).
It is implemented by emuStudio. Plugins obtain this object in the constructor.
Getters return empty Optional if the key is missing or the value has a different type.
Use orElse(default) for default values. Keys are case-sensitive.
Keys must not start with EMUSTUDIO_PREFIX. This prefix is reserved for emuStudio settings, some of which
are readable by plugins.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringBoolean: emuStudio runs without GUI.static final Stringstatic final PluginSettingsSettings which contain nothing and ignore updates. -
Method Summary
Modifier and TypeMethodDescriptiongetBoolean(String key) getSubSettings(String key) voidSets or removes a setting.setSubSettings(String key) Creates (or replaces) nested settings.
-
Field Details
-
EMUSTUDIO_PREFIX
- See Also:
-
EMUSTUDIO_NO_GUI
-
UNAVAILABLE
Settings which contain nothing and ignore updates. Used when emuStudio is not available (e.g. in tests).
-
-
Method Details
-
getString
-
getBoolean
-
getInt
-
getLong
-
getDouble
-
getArray
-
getSubSettings
- Parameters:
key- setting key- Returns:
- nested settings, if present
-
setSubSettings
Creates (or replaces) nested settings.- Parameters:
key- setting key- Returns:
- new empty nested settings
- Throws:
CannotUpdateSettingException- if the settings cannot be updated
-
set
Sets or removes a setting.- Parameters:
key- setting keyvalue- String, Boolean, Integer, Long, Double, or List of Strings; null removes the setting- Throws:
CannotUpdateSettingException- if the settings cannot be updatedIllegalArgumentException- if the value type is not supported
-