org.gudy.azureus2.core3.config.impl
Class ConfigurationDefaults
java.lang.Object
org.gudy.azureus2.core3.config.impl.ConfigurationDefaults
public class ConfigurationDefaults
- extends Object
Some (proposed) option naming conventions:
- Starts with a general identifier
General_ for, well, general things =)
Server_ for webinterface specific things
GUI_ (eventually) for GUI specific things
Core_ (eventually) for core specific things
- Second is some identifing term. It starts with a small letter denoting
the variable type.
b Boolean
i Integer
s String
- Directory options should end with _Directory. This activates some
special validity checks in the webinterface option parsing code.
(Namely they are created if they don't exist and the option isn't changed
with a logged error if a normal file of the same name exists)
Method Summary |
void |
addParameter(String sKey,
boolean bParameter)
|
void |
addParameter(String sKey,
byte[] bParameter)
|
void |
addParameter(String sKey,
float fParameter)
|
void |
addParameter(String sKey,
int iParameter)
|
void |
addParameter(String sKey,
long lParameter)
|
void |
addParameter(String sKey,
String sParameter)
|
protected void |
def_put(String key,
String key_def,
COConfigurationManager.ParameterVerifier verifier)
|
boolean |
doesParameterDefaultExist(String p)
|
Set<String> |
getAllowedParameters()
|
boolean |
getBooleanParameter(String p)
|
byte[] |
getByteParameter(String p)
|
Object |
getDefaultValueAsObject(String key)
Returns the default value as an object (String, Long, Float, Boolean) |
float |
getFloatParameter(String p)
|
static ConfigurationDefaults |
getInstance()
|
int |
getIntParameter(String p)
|
long |
getLongParameter(String p)
|
Object |
getParameter(String key)
|
String |
getStringParameter(String p)
|
List |
getVerifiers(String key)
|
boolean |
hasParameter(String p)
|
void |
registerExternalDefaults(Map addmap)
|
protected void |
runVerifiers()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
def_int
public static final int def_int
- See Also:
- Constant Field Values
def_long
public static final long def_long
- See Also:
- Constant Field Values
def_float
public static final float def_float
- See Also:
- Constant Field Values
def_boolean
public static final int def_boolean
- See Also:
- Constant Field Values
def_String
public static final String def_String
- See Also:
- Constant Field Values
def_bytes
public static final byte[] def_bytes
DEFAULT_FILE_CONVERSION_CHARS
public static final String DEFAULT_FILE_CONVERSION_CHARS
- See Also:
- Constant Field Values
CFG_TORRENTADD_OPENOPTIONS_MANY
public static final String CFG_TORRENTADD_OPENOPTIONS_MANY
- See Also:
- Constant Field Values
CFG_TORRENTADD_OPENOPTIONS_ALWAYS
public static final String CFG_TORRENTADD_OPENOPTIONS_ALWAYS
- See Also:
- Constant Field Values
CFG_TORRENTADD_OPENOPTIONS_NEVER
public static final String CFG_TORRENTADD_OPENOPTIONS_NEVER
- See Also:
- Constant Field Values
CFG_TORRENTADD_OPENOPTIONS
public static final String CFG_TORRENTADD_OPENOPTIONS
- See Also:
- Constant Field Values
CFG_TORRENTADD_OPENOPTIONS_SEP
public static final String CFG_TORRENTADD_OPENOPTIONS_SEP
- See Also:
- Constant Field Values
ConfigurationDefaults
protected ConfigurationDefaults()
- Creates a new instance of Defaults
ConfigurationDefaults
protected ConfigurationDefaults(Map _def)
getInstance
public static ConfigurationDefaults getInstance()
def_put
protected void def_put(String key,
String key_def,
COConfigurationManager.ParameterVerifier verifier)
getStringParameter
public String getStringParameter(String p)
throws ConfigurationParameterNotFoundException
- Throws:
ConfigurationParameterNotFoundException
getIntParameter
public int getIntParameter(String p)
throws ConfigurationParameterNotFoundException
- Throws:
ConfigurationParameterNotFoundException
getLongParameter
public long getLongParameter(String p)
throws ConfigurationParameterNotFoundException
- Throws:
ConfigurationParameterNotFoundException
getFloatParameter
public float getFloatParameter(String p)
throws ConfigurationParameterNotFoundException
- Throws:
ConfigurationParameterNotFoundException
getByteParameter
public byte[] getByteParameter(String p)
throws ConfigurationParameterNotFoundException
- Throws:
ConfigurationParameterNotFoundException
getBooleanParameter
public boolean getBooleanParameter(String p)
throws ConfigurationParameterNotFoundException
- Throws:
ConfigurationParameterNotFoundException
hasParameter
public boolean hasParameter(String p)
getDefaultValueAsObject
public Object getDefaultValueAsObject(String key)
- Returns the default value as an object (String, Long, Float, Boolean)
- Parameters:
key
-
- Returns:
- default value
getAllowedParameters
public Set<String> getAllowedParameters()
addParameter
public void addParameter(String sKey,
String sParameter)
addParameter
public void addParameter(String sKey,
int iParameter)
addParameter
public void addParameter(String sKey,
byte[] bParameter)
addParameter
public void addParameter(String sKey,
boolean bParameter)
addParameter
public void addParameter(String sKey,
long lParameter)
addParameter
public void addParameter(String sKey,
float fParameter)
registerExternalDefaults
public void registerExternalDefaults(Map addmap)
doesParameterDefaultExist
public boolean doesParameterDefaultExist(String p)
getParameter
public Object getParameter(String key)
getVerifiers
public List getVerifiers(String key)
runVerifiers
protected void runVerifiers()