Class RPPluginConfig
- All Implemented Interfaces:
PluginConfig, Serializable
- See Also:
-
Field Summary
FieldsFields inherited from class RPObject
__delegate, _dispatcher, _object_id, next_key, object_registry, object_registry_reverseFields inherited from interface PluginConfig
CORE_PARAM_BOOLEAN_AUTO_SPEED_ON, CORE_PARAM_BOOLEAN_AUTO_SPEED_SEEDING_ON, CORE_PARAM_BOOLEAN_FRIENDLY_HASH_CHECKING, CORE_PARAM_BOOLEAN_MAX_ACTIVE_SEEDING, CORE_PARAM_BOOLEAN_MAX_UPLOAD_SPEED_SEEDING, CORE_PARAM_BOOLEAN_NEW_SEEDS_START_AT_TOP, CORE_PARAM_BOOLEAN_NEW_TORRENTS_START_AS_STOPPED, CORE_PARAM_BOOLEAN_SOCKS_PROXY_NO_INWARD_CONNECTION, CORE_PARAM_INT_INCOMING_TCP_PORT, CORE_PARAM_INT_INCOMING_UDP_PORT, CORE_PARAM_INT_MAX_ACTIVE, CORE_PARAM_INT_MAX_ACTIVE_SEEDING, CORE_PARAM_INT_MAX_CONNECTIONS_GLOBAL, CORE_PARAM_INT_MAX_CONNECTIONS_PER_TORRENT, CORE_PARAM_INT_MAX_DOWNLOAD_SPEED_KBYTES_PER_SEC, CORE_PARAM_INT_MAX_DOWNLOADS, CORE_PARAM_INT_MAX_UPLOAD_SPEED_KBYTES_PER_SEC, CORE_PARAM_INT_MAX_UPLOAD_SPEED_SEEDING_KBYTES_PER_SEC, CORE_PARAM_INT_MAX_UPLOADS, CORE_PARAM_INT_MAX_UPLOADS_SEEDING, CORE_PARAM_LONG_MAX_DOWNLOAD_SPEED_KBYTES_PER_SEC, CORE_PARAM_LONG_MAX_UPLOAD_SPEED_KBYTES_PER_SEC, CORE_PARAM_LONG_MAX_UPLOAD_SPEED_SEEDING_KBYTES_PER_SEC, CORE_PARAM_STRING_DEFAULT_SAVE_PATH, CORE_PARAM_STRING_LOCAL_BIND_IP, GUI_PARAM_INT_SWT_REFRESH_IN_MS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void_setDelegate(Object _delegate) void_setRemote(RPRequestDispatcher _dispatcher) voidstatic PluginConfigcreate(PluginConfig _delegate) Enable the plugin to store configuration parameters into a separate external configuration file.booleanReturns the value of a core boolean parameter.byte[]Returns the value of a core byte array parameter.int[]Returns the value of a core color parameter.floatReturns the value of a core float parameter.intReturns the value of a core int parameter.longReturns the value of a core long parameter.Returns the value of a core string parameter.getParameter(String key) booleanReturns the value of a plugin boolean parameter.booleangetPluginBooleanParameter(String key, boolean defaultValue) Returns the value of a plugin boolean parameter.byte[]Returns the value of a plugin byte array parameter.byte[]getPluginByteParameter(String key, byte[] defaultValue) Returns the value of a plugin byte array parameter.int[]Returns the value of a plugin color parameter.int[]getPluginColorParameter(String key, int[] default_value) Returns the value of a plugin color parameter.Returns the PluginConfigSource object used for this plugin configuration (or null if an external configuration object isn't used).floatReturns the value of a plugin float parameter.floatgetPluginFloatParameter(String key, float default_value) Returns the value of a plugin float parameter.intReturns the value of a plugin int parameter.intgetPluginIntParameter(String key, int defaultValue) Returns the value of a plugin int parameter.getPluginListParameter(String key, List default_value) Returns the value of a plugin list parameter.longReturns the value of a plugin long parameter.longgetPluginLongParameter(String key, long default_value) Returns the value of a plugin long parameter.getPluginMapParameter(String key, Map default_value) Returns the value of a plugin map parameter.getPluginParameter(String key) String[]Returns the value of a plugin string-list parameter.Returns the value of a plugin string parameter.getPluginStringParameter(String key, String defaultValue) Returns the value of a plugin string parameter.getPluginUserFile(String name) Returns a file that can be used by the plugin to save user-specific state.booleanReturns the value of a core boolean parameter.booleangetUnsafeBooleanParameter(String key, boolean default_value) Returns the value of a core boolean parameter.byte[]Returns the value of a core byte array parameter.byte[]getUnsafeByteParameter(String key, byte[] default_value) Returns the value of a core byte array parameter.int[]Returns the value of a core color parameter.int[]getUnsafeColorParameter(String key, int[] default_value) Returns the value of a core color parameter.floatReturns the value of a core float parameter.floatgetUnsafeFloatParameter(String key, float default_value) Returns the value of a core float parameter.intReturns the value of a core int parameter.intgetUnsafeIntParameter(String key, int default_value) Returns the value of a core int parameter.longReturns the value of a core long parameter.longgetUnsafeLongParameter(String key, long default_value) Returns the value of a core long parameter.Returns a mapinvalid input: '<'String,Object> giving parameter names -> parameter values.Returns the value of a core string parameter.getUnsafeStringParameter(String key, String default_value) Returns the value of a core string parameter.booleanReturns true if a core parameter with the given name exists.booleanReturns true if a plugin parameter with the given name exists.booleanvoidbooleanRemoves the plugin color parameter with the given name.booleanRemoves the plugin parameter with the given name.voidsave()make sure you save it after making changes!voidsetCoreBooleanParameter(String key, boolean value) Sets the value of a core boolean parameter.voidsetCoreByteParameter(String key, byte[] value) Sets the value of a core byte array parameter.voidsetCoreColorParameter(String key, int[] value) Sets the value of a core byte array parameter.voidsetCoreColorParameter(String key, int[] value, boolean override) Sets the value of a core byte array parameter.voidsetCoreFloatParameter(String key, float value) Sets the value of a core float parameter.voidsetCoreIntParameter(String key, int value) Sets the value of a core int parameter.voidsetCoreLongParameter(String key, long value) Sets the value of a core long parameter.voidsetCoreStringParameter(String key, String value) Sets the value of a core string parameter.voidsetPluginColorParameter(String key, int[] value) Sets the value of a plugin color parameter.voidsetPluginColorParameter(String key, int[] value, boolean override) Sets the value of a plugin color parameter.voidvoidSets the plugin configuration source object to use for storing parameters for this plugin config object.voidsetPluginListParameter(String key, List value) Sets the value of a plugin list parameter.voidsetPluginMapParameter(String key, Map value) Sets the value of a plugin map parameter.voidsetPluginParameter(String key, boolean value) Sets the value of a plugin boolean parameter.voidsetPluginParameter(String key, byte[] value) Sets the value of a plugin byte array parameter.voidsetPluginParameter(String key, float value) Sets the value of a plugin float parameter.voidsetPluginParameter(String key, int value) Sets the value of a plugin int parameter.voidsetPluginParameter(String key, int value, boolean global) Sets the value of a plugin int parameter.voidsetPluginParameter(String key, long value) Sets the value of a plugin long parameter.voidsetPluginParameter(String key, String value) Sets the value of a plugin string parameter.voidsetPluginStringListParameter(String key, String[] value) Sets the value of a plugin string-list parameter.voidsetUnsafeBooleanParameter(String key, boolean value) Sets the value of a core boolean parameter.voidsetUnsafeByteParameter(String key, byte[] value) Sets the value of a core byte array parameter.voidsetUnsafeColorParameter(String key, int[] default_value) Returns the value of a core color parameter.voidsetUnsafeColorParameter(String key, int[] default_value, boolean override) Returns the value of a core color parameter.voidsetUnsafeFloatParameter(String key, float value) Sets the value of a core float parameter.voidsetUnsafeIntParameter(String key, int value) Sets the value of a core int parameter.voidsetUnsafeLongParameter(String key, long value) Sets the value of a core long parameter.voidsetUnsafeStringParameter(String key, String value) Sets the value of a core string parameter.Methods inherited from class RPObject
_fixupLocal, _getDelegate, _getName, _getOID, _lookupLocal, _lookupLocal, _refresh, getDispatcher, notSupported, notSupported
-
Field Details
-
delegate
-
property_cache
-
cached_property_names
-
cached_property_values
-
-
Constructor Details
-
RPPluginConfig
-
-
Method Details
-
create
-
_setDelegate
- Overrides:
_setDelegatein classRPObject
-
_setLocal
- Overrides:
_setLocalin classRPObject- Throws:
RPException
-
_setRemote
- Overrides:
_setRemotein classRPObject
-
_process
-
isNewInstall
public boolean isNewInstall()- Specified by:
isNewInstallin interfacePluginConfig
-
getPluginConfigKeyPrefix
- Specified by:
getPluginConfigKeyPrefixin interfacePluginConfig- Returns:
- the prefix used when storing configuration values in the config file for this plugin's config parameters
-
getPluginListParameter
Description copied from interface:PluginConfigReturns the value of a plugin list parameter. The contents of the list must conform to bencodable rules (e.g. Map, Long, byte[], List)- Specified by:
getPluginListParameterin interfacePluginConfig- Parameters:
key- The parameter name.default_value- The default value to return if one is not defined.- Returns:
- The value of the parameter.
-
setPluginListParameter
Description copied from interface:PluginConfigSets the value of a plugin list parameter. The contents of the list must conform to bencodable rules (e.g. Map, Long, byte[], List)- Specified by:
setPluginListParameterin interfacePluginConfig- Parameters:
key- The parameter name.value- The new value for the parameter.
-
getPluginMapParameter
Description copied from interface:PluginConfigReturns the value of a plugin map parameter. The contents of the map must conform to bencodable rules (e.g. Map, Long, byte[], List)- Specified by:
getPluginMapParameterin interfacePluginConfig- Parameters:
key- The parameter name.default_value- The default value to return if one is not defined.- Returns:
- The value of the parameter.
-
setPluginMapParameter
Description copied from interface:PluginConfigSets the value of a plugin map parameter. The contents of the map must conform to bencodable rules (e.g. Map, Long, byte[], List)- Specified by:
setPluginMapParameterin interfacePluginConfig- Parameters:
key- The parameter name.value- The new value for the parameter.
-
getPluginIntParameter
Description copied from interface:PluginConfigReturns the value of a plugin int parameter.- Specified by:
getPluginIntParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
getPluginIntParameter
Description copied from interface:PluginConfigReturns the value of a plugin int parameter.- Specified by:
getPluginIntParameterin interfacePluginConfig- Parameters:
key- The parameter name.defaultValue- The default value to return if one is not defined.- Returns:
- The value of the parameter.
-
getPluginStringParameter
Description copied from interface:PluginConfigReturns the value of a plugin string parameter.- Specified by:
getPluginStringParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
getPluginStringParameter
Description copied from interface:PluginConfigReturns the value of a plugin string parameter.- Specified by:
getPluginStringParameterin interfacePluginConfig- Parameters:
key- The parameter name.defaultValue- The default value to return if one is not defined.- Returns:
- The value of the parameter.
-
getPluginBooleanParameter
Description copied from interface:PluginConfigReturns the value of a plugin boolean parameter.- Specified by:
getPluginBooleanParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
getPluginByteParameter
Description copied from interface:PluginConfigReturns the value of a plugin byte array parameter.- Specified by:
getPluginByteParameterin interfacePluginConfig- Parameters:
key- The parameter name.defaultValue- The default value to return if one is not defined.- Returns:
- The value of the parameter.
-
getPluginBooleanParameter
Description copied from interface:PluginConfigReturns the value of a plugin boolean parameter.- Specified by:
getPluginBooleanParameterin interfacePluginConfig- Parameters:
key- The parameter name.defaultValue- The default value to return if one is not defined.- Returns:
- The value of the parameter.
-
setPluginParameter
Description copied from interface:PluginConfigSets the value of a plugin int parameter.- Specified by:
setPluginParameterin interfacePluginConfig- Parameters:
key- The parameter name.value- The new value for the parameter.
-
setPluginParameter
Description copied from interface:PluginConfigSets the value of a plugin int parameter.- Specified by:
setPluginParameterin interfacePluginConfig- Parameters:
key- The parameter name.value- The new value for the parameter.global- Whether or not this parameter should be made externally accessible.
-
setPluginParameter
Description copied from interface:PluginConfigSets the value of a plugin string parameter.- Specified by:
setPluginParameterin interfacePluginConfig- Parameters:
key- The parameter name.value- The new value for the parameter.
-
setPluginParameter
Description copied from interface:PluginConfigSets the value of a plugin boolean parameter.- Specified by:
setPluginParameterin interfacePluginConfig- Parameters:
key- The parameter name.value- The new value for the parameter.
-
setPluginParameter
Description copied from interface:PluginConfigSets the value of a plugin byte array parameter.- Specified by:
setPluginParameterin interfacePluginConfig- Parameters:
key- The parameter name.value- The new value for the parameter.
-
getParameter
- Specified by:
getParameterin interfacePluginConfig
-
getPluginParameter
- Specified by:
getPluginParameterin interfacePluginConfig
-
getUnsafeBooleanParameter
Description copied from interface:PluginConfigReturns the value of a core boolean parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.- Specified by:
getUnsafeBooleanParameterin interfacePluginConfig- Parameters:
key- The parameter name.default_value- The default value to return if one is not defined.- Returns:
- The value of the parameter.
-
setUnsafeBooleanParameter
Description copied from interface:PluginConfigSets the value of a core boolean parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.- Specified by:
setUnsafeBooleanParameterin interfacePluginConfig- Parameters:
key- The parameter name, which must be one defined from the above core constants.value- The new value for the parameter.
-
getUnsafeIntParameter
Description copied from interface:PluginConfigReturns the value of a core int parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.- Specified by:
getUnsafeIntParameterin interfacePluginConfig- Parameters:
key- The parameter name.default_value- The default value to return if one is not defined.- Returns:
- The value of the parameter.
-
setUnsafeIntParameter
Description copied from interface:PluginConfigSets the value of a core int parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.- Specified by:
setUnsafeIntParameterin interfacePluginConfig- Parameters:
key- The parameter name, which must be one defined from the above core constants.value- The new value for the parameter.
-
getUnsafeLongParameter
Description copied from interface:PluginConfigReturns the value of a core long parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.- Specified by:
getUnsafeLongParameterin interfacePluginConfig- Parameters:
key- The parameter name.default_value- The default value to return if one is not defined.- Returns:
- The value of the parameter.
-
setUnsafeLongParameter
Description copied from interface:PluginConfigSets the value of a core long parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.- Specified by:
setUnsafeLongParameterin interfacePluginConfig- Parameters:
key- The parameter name, which must be one defined from the above core constants.value- The new value for the parameter.
-
getUnsafeFloatParameter
Description copied from interface:PluginConfigReturns the value of a core float parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.- Specified by:
getUnsafeFloatParameterin interfacePluginConfig- Parameters:
key- The parameter name.default_value- The default value to return if one is not defined.- Returns:
- The value of the parameter.
-
setUnsafeFloatParameter
Description copied from interface:PluginConfigSets the value of a core float parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.- Specified by:
setUnsafeFloatParameterin interfacePluginConfig- Parameters:
key- The parameter name, which must be one defined from the above core constants.value- The new value for the parameter.
-
getUnsafeStringParameter
Description copied from interface:PluginConfigReturns the value of a core string parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.- Specified by:
getUnsafeStringParameterin interfacePluginConfig- Parameters:
key- The parameter name.default_value- The default value to return if one is not defined.- Returns:
- The value of the parameter.
-
setUnsafeStringParameter
Description copied from interface:PluginConfigSets the value of a core string parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.- Specified by:
setUnsafeStringParameterin interfacePluginConfig- Parameters:
key- The parameter name, which must be one defined from the above core constants.value- The new value for the parameter.
-
getUnsafeParameterList
Description copied from interface:PluginConfigReturns a mapinvalid input: '<'String,Object> giving parameter names -> parameter values. Value can be Long or String as the type is actually not known by the core (might fix one day). Therefore, float values are actually represented by their String format: boolean - Long 0 or 1 int - Long.intValue float - String value String - String Unsafe methods - existence/semantics of parameters not guaranteed to be maintained across versions If something changes and breaks your plugin, don't come complaining to me- Specified by:
getUnsafeParameterListin interfacePluginConfig
-
save
Description copied from interface:PluginConfigmake sure you save it after making changes!- Specified by:
savein interfacePluginConfig- Throws:
PluginException
-
getPluginUserFile
Description copied from interface:PluginConfigReturns a file that can be used by the plugin to save user-specific state.This will be client-user-dir/plugins/plugin-name/name.
- Specified by:
getPluginUserFilein interfacePluginConfig- Parameters:
name-- Returns:
-
addListener
- Specified by:
addListenerin interfacePluginConfig
-
removeListener
- Specified by:
removeListenerin interfacePluginConfig
-
setPluginConfigKeyPrefix
- Specified by:
setPluginConfigKeyPrefixin interfacePluginConfig- Parameters:
_key-
-
hasParameter
Description copied from interface:PluginConfigReturns true if a core parameter with the given name exists.- Specified by:
hasParameterin interfacePluginConfig
-
hasPluginParameter
Description copied from interface:PluginConfigReturns true if a plugin parameter with the given name exists.- Specified by:
hasPluginParameterin interfacePluginConfig
-
removePluginParameter
Description copied from interface:PluginConfigRemoves the plugin parameter with the given name.- Specified by:
removePluginParameterin interfacePluginConfig- Parameters:
x- Name of the parameter.- Returns:
- true if the parameter was found and removed.
-
removePluginColorParameter
Description copied from interface:PluginConfigRemoves the plugin color parameter with the given name.- Specified by:
removePluginColorParameterin interfacePluginConfig- Parameters:
x- Name of the parameter.- Returns:
- true if the parameter was found and removed.
-
getPluginByteParameter
Description copied from interface:PluginConfigReturns the value of a plugin byte array parameter.- Specified by:
getPluginByteParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
getPluginFloatParameter
Description copied from interface:PluginConfigReturns the value of a plugin float parameter.- Specified by:
getPluginFloatParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
getPluginFloatParameter
Description copied from interface:PluginConfigReturns the value of a plugin float parameter.- Specified by:
getPluginFloatParameterin interfacePluginConfig- Parameters:
key- The parameter name.default_value- The default value to return if one is not defined.- Returns:
- The value of the parameter.
-
getPluginLongParameter
Description copied from interface:PluginConfigReturns the value of a plugin long parameter.- Specified by:
getPluginLongParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
getPluginLongParameter
Description copied from interface:PluginConfigReturns the value of a plugin long parameter.- Specified by:
getPluginLongParameterin interfacePluginConfig- Parameters:
key- The parameter name.default_value- The default value to return if one is not defined.- Returns:
- The value of the parameter.
-
setPluginParameter
Description copied from interface:PluginConfigSets the value of a plugin float parameter.- Specified by:
setPluginParameterin interfacePluginConfig- Parameters:
key- The parameter name.value- The new value for the parameter.
-
setPluginParameter
Description copied from interface:PluginConfigSets the value of a plugin long parameter.- Specified by:
setPluginParameterin interfacePluginConfig- Parameters:
key- The parameter name.value- The new value for the parameter.
-
getUnsafeBooleanParameter
Description copied from interface:PluginConfigReturns the value of a core boolean parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.- Specified by:
getUnsafeBooleanParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
getUnsafeByteParameter
Description copied from interface:PluginConfigReturns the value of a core byte array parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.- Specified by:
getUnsafeByteParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
getUnsafeByteParameter
Description copied from interface:PluginConfigReturns the value of a core byte array parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.- Specified by:
getUnsafeByteParameterin interfacePluginConfig- Parameters:
key- The parameter name.default_value- The default value to return if one is not defined.- Returns:
- The value of the parameter.
-
getUnsafeFloatParameter
Description copied from interface:PluginConfigReturns the value of a core float parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.- Specified by:
getUnsafeFloatParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
getUnsafeIntParameter
Description copied from interface:PluginConfigReturns the value of a core int parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.- Specified by:
getUnsafeIntParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
getUnsafeLongParameter
Description copied from interface:PluginConfigReturns the value of a core long parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.- Specified by:
getUnsafeLongParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
getUnsafeStringParameter
Description copied from interface:PluginConfigReturns the value of a core string parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.- Specified by:
getUnsafeStringParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
setUnsafeByteParameter
Description copied from interface:PluginConfigSets the value of a core byte array parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.- Specified by:
setUnsafeByteParameterin interfacePluginConfig- Parameters:
key- The parameter name, which must be one defined from the above core constants.value- The new value for the parameter.
-
getCoreBooleanParameter
Description copied from interface:PluginConfigReturns the value of a core boolean parameter.- Specified by:
getCoreBooleanParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
getCoreByteParameter
Description copied from interface:PluginConfigReturns the value of a core byte array parameter.- Specified by:
getCoreByteParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
getCoreFloatParameter
Description copied from interface:PluginConfigReturns the value of a core float parameter.- Specified by:
getCoreFloatParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
getCoreIntParameter
Description copied from interface:PluginConfigReturns the value of a core int parameter.- Specified by:
getCoreIntParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
getCoreStringParameter
Description copied from interface:PluginConfigReturns the value of a core string parameter.- Specified by:
getCoreStringParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
getCoreLongParameter
Description copied from interface:PluginConfigReturns the value of a core long parameter.- Specified by:
getCoreLongParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
setCoreBooleanParameter
Description copied from interface:PluginConfigSets the value of a core boolean parameter.- Specified by:
setCoreBooleanParameterin interfacePluginConfig- Parameters:
key- The parameter name, which must be one defined from the above core constants.value- The new value for the parameter.
-
setCoreByteParameter
Description copied from interface:PluginConfigSets the value of a core byte array parameter.- Specified by:
setCoreByteParameterin interfacePluginConfig- Parameters:
key- The parameter name, which must be one defined from the above core constants.value- The new value for the parameter.
-
setCoreFloatParameter
Description copied from interface:PluginConfigSets the value of a core float parameter.- Specified by:
setCoreFloatParameterin interfacePluginConfig- Parameters:
key- The parameter name, which must be one defined from the above core constants.value- The new value for the parameter.
-
setCoreIntParameter
Description copied from interface:PluginConfigSets the value of a core int parameter.- Specified by:
setCoreIntParameterin interfacePluginConfig- Parameters:
key- The parameter name, which must be one defined from the above core constants.value- The new value for the parameter.
-
setCoreLongParameter
Description copied from interface:PluginConfigSets the value of a core long parameter.- Specified by:
setCoreLongParameterin interfacePluginConfig- Parameters:
key- The parameter name, which must be one defined from the above core constants.value- The new value for the parameter.
-
setCoreStringParameter
Description copied from interface:PluginConfigSets the value of a core string parameter.- Specified by:
setCoreStringParameterin interfacePluginConfig- Parameters:
key- The parameter name, which must be one defined from the above core constants.value- The new value for the parameter.
-
getCoreColorParameter
Description copied from interface:PluginConfigReturns the value of a core color parameter.It will return null if no color parameter is stored, or an integer array of size 4 representing the red, green and blue values, and a flag indicating if the color is an override of the default or not (0 indicates no override, 1 means it is overridden).
In many cases, the override flag can just be ignored.
- Specified by:
getCoreColorParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
setCoreColorParameter
Description copied from interface:PluginConfigSets the value of a core byte array parameter.The value should be an integer array of size 3 representing the red, green and blue values - or null to disable it.
- Specified by:
setCoreColorParameterin interfacePluginConfig- Parameters:
key- The parameter name, which must be one defined from the above core constants.value- The new value for the parameter.
-
setCoreColorParameter
Description copied from interface:PluginConfigSets the value of a core byte array parameter.The value should be an integer array of size 3 representing the red, green and blue values - or null to disable it.
The override flag is used to indicate if the value being set is overriding the default value. This is mainly used for interface purposes.
- Specified by:
setCoreColorParameterin interfacePluginConfig- Parameters:
key- The parameter name, which must be one defined from the above core constants.value- The new value for the parameter.override- true if the value is overridden from the default.
-
getPluginColorParameter
Description copied from interface:PluginConfigReturns the value of a plugin color parameter.It will return null if no color parameter is stored, or an integer array of size 4 representing the red, green and blue values, and a flag indicating if the color is an override of the default or not (0 indicates no override, 1 means it is overridden).
In many cases, the override flag can just be ignored.
- Specified by:
getPluginColorParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
getPluginColorParameter
Description copied from interface:PluginConfigReturns the value of a plugin color parameter.It will return null if no color parameter is stored, or an integer array of size 4 representing the red, green and blue values, and a flag indicating if the color is an override of the default or not (0 indicates no override, 1 means it is overridden).
In many cases, the override flag can just be ignored.
- Specified by:
getPluginColorParameterin interfacePluginConfig- Parameters:
key- The parameter name.default_value- The default value to return if one is not defined.- Returns:
- The value of the parameter.
-
setPluginColorParameter
Description copied from interface:PluginConfigSets the value of a plugin color parameter.The value should be an integer array of size 3 representing the red, green and blue values - or null to disable it.
- Specified by:
setPluginColorParameterin interfacePluginConfig- Parameters:
key- The parameter name.value- The new value for the parameter.
-
setPluginColorParameter
Description copied from interface:PluginConfigSets the value of a plugin color parameter.The value should be an integer array of size 3 representing the red, green and blue values - or null to disable it.
The override flag is used to indicate if the value being set is overriding the default value. This is mainly used for interface purposes.
- Specified by:
setPluginColorParameterin interfacePluginConfig- Parameters:
key- The parameter name.value- The new value for the parameter.override- true if the value is overridden from the default.
-
getUnsafeColorParameter
Description copied from interface:PluginConfigReturns the value of a core color parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.It will return null if no color parameter is stored, or an integer array of size 4 representing the red, green and blue values, and a flag indicating if the color is an override of the default or not (0 indicates no override, 1 means it is overridden).
In many cases, the override flag can just be ignored.
- Specified by:
getUnsafeColorParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-
getUnsafeColorParameter
Description copied from interface:PluginConfigReturns the value of a core color parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.It will return null if no color parameter is stored, or an integer array of size 4 representing the red, green and blue values, and a flag indicating if the color is an override of the default or not (0 indicates no override, 1 means it is overridden).
In many cases, the override flag can just be ignored.
- Specified by:
getUnsafeColorParameterin interfacePluginConfig- Parameters:
key- The parameter name.default_value- The default value to return if one is not defined.- Returns:
- The value of the parameter.
-
setUnsafeColorParameter
Description copied from interface:PluginConfigReturns the value of a core color parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.The value should be an integer array of size 3 representing the red, green and blue values - or null to disable it.
- Specified by:
setUnsafeColorParameterin interfacePluginConfig- Parameters:
key- The parameter name.default_value- The new value for the parameter.
-
setUnsafeColorParameter
Description copied from interface:PluginConfigReturns the value of a core color parameter. Note: the semantics of this method will not be guaranteed - core parameter names may change in the future, and this method will not do any parameter name mapping for you, so take care when using this method.The value should be an integer array of size 3 representing the red, green and blue values - or null to disable it.
The override flag is used to indicate if the value being set is overriding the default value. This is mainly used for interface purposes.
- Specified by:
setUnsafeColorParameterin interfacePluginConfig- Parameters:
key- The parameter name.default_value- The default value to return if one is not defined.override- true if the value is overridden from the default.
-
getPluginConfigSource
Description copied from interface:PluginConfigReturns the PluginConfigSource object used for this plugin configuration (or null if an external configuration object isn't used).- Specified by:
getPluginConfigSourcein interfacePluginConfig- Returns:
- The PluginConfigSource object.
-
setPluginConfigSource
Description copied from interface:PluginConfigSets the plugin configuration source object to use for storing parameters for this plugin config object.This method should only be used as an alternative to
PluginConfig.enableExternalConfigSource(). You will only need to use this method if you use thegetLocalPluginInterfacemethod to store data in a separate namespace, but want to use the same configuration file to store data in.- Specified by:
setPluginConfigSourcein interfacePluginConfig- Parameters:
source- The PluginConfigSource object to use.
-
enableExternalConfigSource
Description copied from interface:PluginConfigEnable the plugin to store configuration parameters into a separate external configuration file. Note: once this method is called, you need to invokePluginConfigSource.initialize()for the external configuration file to be properly integrated with the client.When a plugin is first initialised, it should call this method as soon as possible during the initialization stage. This then configures the PluginConfig object to store any parameter values into an external configuration file (rather than storing it directly with the main configuration file used by the client).
When this method is invoked, it will return an object which allows the filename to be chosen - it allows a limited amount of manipulation of the configuration file. This method only needs to be invoked once.
All methods which get and set plugin parameters on this object will store data in the external configuration file. The use of classes like
BasicPluginConfigModelwill automatically integrate parameters to the external configuration source.However, if you use any other mechanism to store parameter data, you may need to call the
to integrate the parameter properly.invalid reference
registerParameter- Specified by:
enableExternalConfigSourcein interfacePluginConfig- Returns:
- The PluginConfigSource object representing the external configuration file.
-
setPluginStringListParameter
Description copied from interface:PluginConfigSets the value of a plugin string-list parameter.- Specified by:
setPluginStringListParameterin interfacePluginConfig- Parameters:
key- The parameter name.value- The new value of the parameter.
-
getPluginStringListParameter
Description copied from interface:PluginConfigReturns the value of a plugin string-list parameter. If no value is set, an empty string array will be returned.- Specified by:
getPluginStringListParameterin interfacePluginConfig- Parameters:
key- The parameter name.- Returns:
- The value of the parameter.
-