public abstract class InstanceProperties extends Object
InstanceProperties.remove()
call.
In the scope of namespace used in InstancePropertiesManager
the object has assigned unique id identifying it.
Constructor and Description |
---|
InstanceProperties(String id)
Creates the new InstanceProperties.
|
Modifier and Type | Method and Description |
---|---|
abstract boolean |
getBoolean(String key,
boolean def)
Returns the value of the given property.
|
abstract double |
getDouble(String key,
double def)
Returns the value of the given property.
|
abstract float |
getFloat(String key,
float def)
Returns the value of the given property.
|
String |
getId()
Returns unique id of these properties.
|
abstract int |
getInt(String key,
int def)
Returns the value of the given property.
|
abstract long |
getLong(String key,
long def)
Returns the value of the given property.
|
abstract String |
getString(String key,
String def)
Returns the value of the given property.
|
abstract void |
putBoolean(String key,
boolean value)
Associates the specified value with the specified property.
|
abstract void |
putDouble(String key,
double value)
Associates the specified value with the specified property.
|
abstract void |
putFloat(String key,
float value)
Associates the specified value with the specified property.
|
abstract void |
putInt(String key,
int value)
Associates the specified value with the specified property.
|
abstract void |
putLong(String key,
long value)
Associates the specified value with the specified property.
|
abstract void |
putString(String key,
String value)
Associates the specified value with the specified property.
|
abstract void |
remove()
Removes this instance from the persistent space.
|
abstract void |
removeKey(String key)
Removes the value of the given property, if any.
|
public InstanceProperties(String id)
id
- id of the properties, unique in the scope of the namespaceInstancePropertiesManager
public final String getId()
Client may use it for its own purposes (don't have to), but client can't influence the actual value of id in any way.
InstancePropertiesManager
,
InstancePropertiesManager.createProperties(String)
public abstract String getString(String key, String def)
InstanceProperties.putString(String, String)
.key
- name of the propertydef
- default valuepublic abstract void putString(String key, String value)
InstanceProperties.getString(String, String)
.key
- name of the propertyvalue
- value to setpublic abstract boolean getBoolean(String key, boolean def)
InstanceProperties.putBoolean(String, boolean)
.key
- name of the propertydef
- default valuepublic abstract void putBoolean(String key, boolean value)
InstanceProperties.getBoolean(String, boolean)
.key
- name of the propertyvalue
- value to setpublic abstract int getInt(String key, int def)
Integer.parseInt(String)
. However this method
is designed to be used in conjuction with InstanceProperties.putInt(String, int)
.key
- name of the propertydef
- default valuepublic abstract void putInt(String key, int value)
InstanceProperties.getInt(String, int)
.key
- name of the propertyvalue
- value to setpublic abstract long getLong(String key, long def)
Long.parseLong(String)
. However this method
is designed to be used in conjuction with InstanceProperties.putLong(String, long)
.key
- name of the propertydef
- default valuepublic abstract void putLong(String key, long value)
InstanceProperties.getLong(String, long)
.key
- name of the propertyvalue
- value to setpublic abstract float getFloat(String key, float def)
Float.parseFloat(String)
. However this method
is designed to be used in conjuction with
InstanceProperties.putFloat(String, float)
.key
- name of the propertydef
- default valuepublic abstract void putFloat(String key, float value)
InstanceProperties.getFloat(String, float)
.key
- name of the propertyvalue
- value to setpublic abstract double getDouble(String key, double def)
Double.parseDouble(String)
. However this method
is designed to be used in conjuction with
InstanceProperties.putDouble(String, double)
.key
- name of the propertydef
- default valuepublic abstract void putDouble(String key, double value)
InstanceProperties.getDouble(String, double)
.key
- name of the propertyvalue
- value to setpublic abstract void removeKey(String key)
key
- name of the propertypublic abstract void remove()
InstancePropertiesManager.getProperties(String)
with appropriate
parameter will not contain this set of properties anymore.
Return value of any method after removal is not defined and most
likely will lead to IllegalStateException
.