- All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>
This class contains a number of properties ((key,value)-pairs). Additionally, it adds the possibility for callbacks, to allow immediate response to changing properties.
- See Also:
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCallback interface for property change notifications.Field Summary
Fields inherited from class Properties
defaultsConstructor Summary
ConstructorsConstructorDescriptionEmpty I2PProperties with no default values.I2PProperties(Properties defaults) I2PProperties with the given default values.Method Summary
All MethodsModifier and TypeMethodDescriptionvoidaddCallBack(I2PProperties.I2PPropertyCallback callback) Registers a callback for property change notifications.clone()Returns a shallow copy of this properties instance.voidUnregisters a callback.setProperty(String key, String value) Store the property value and notify registered callbacks.Methods inherited from class Properties
clear, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, getProperty, hashCode, isEmpty, keys, keySet, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
Constructor Details
I2PProperties
public I2PProperties()Empty I2PProperties with no default values.I2PProperties
I2PProperties with the given default values.- Parameters:
defaults- the default property values
Method Details
clone
Returns a shallow copy of this properties instance.- Overrides:
clonein classProperties
addCallBack
Registers a callback for property change notifications.- Parameters:
callback- the callback to register
removeCallBack
Unregisters a callback.- Parameters:
callback- the callback to remove
setProperty
Store the property value and notify registered callbacks.- Overrides:
setPropertyin classProperties- Returns:
- the previous value, or null