public class SystemProperties extends Object
Modifier and Type | Field and Description |
---|---|
static int |
PROP_NAME_MAX |
static int |
PROP_VALUE_MAX |
Constructor and Description |
---|
SystemProperties() |
Modifier and Type | Method and Description |
---|---|
static void |
addChangeCallback(Runnable callback) |
static String |
get(String key)
Get the value for the given key.
|
static String |
get(String key,
String def)
Get the value for the given key.
|
static boolean |
getBoolean(String key,
boolean def)
Get the value for the given key, returned as a boolean.
|
static int |
getInt(String key,
int def)
Get the value for the given key, and return as an integer.
|
static long |
getLong(String key,
long def)
Get the value for the given key, and return as a long.
|
static void |
set(String key,
String val)
Set the value for the given key.
|
public static final int PROP_NAME_MAX
public static final int PROP_VALUE_MAX
public static String get(String key)
IllegalArgumentException
- if the key exceeds 32 characterspublic static String get(String key, String def)
IllegalArgumentException
- if the key exceeds 32 characterspublic static int getInt(String key, int def)
key
- the key to lookupdef
- a default value to returnIllegalArgumentException
- if the key exceeds 32 characterspublic static long getLong(String key, long def)
key
- the key to lookupdef
- a default value to returnIllegalArgumentException
- if the key exceeds 32 characterspublic static boolean getBoolean(String key, boolean def)
key
- the key to lookupdef
- a default value to returnIllegalArgumentException
- if the key exceeds 32 characterspublic static void set(String key, String val)
IllegalArgumentException
- if the key exceeds 32 charactersIllegalArgumentException
- if the value exceeds 92 characterspublic static void addChangeCallback(Runnable callback)