Interface TraceAddressPropertyManager
- All Known Implementing Classes:
DBTraceAddressPropertyManager
Clients may create property maps of various value types. Each map is named, also considered the "property name," and can be retrieve by that name.
-
Method Summary
Modifier and TypeMethodDescription<T> TracePropertyMap<T> createPropertyMap(String name, Class<T> valueClass) Create a property map with the given name having the given typeGet a copy of all the defined properties<T> TracePropertyMap<T> getOrCreatePropertyMap(String name, Class<T> valueClass) Get the property map with the given name, creating it if necessary, of the given type<T> TracePropertyMap<? super T> getOrCreatePropertyMapSuper(String name, Class<T> valueClass) Get the property map with the given name, creating it if necessary, of the given typegetPropertyMap(String name) Get the property map with the given name.<T> TracePropertyMap<T> getPropertyMap(String name, Class<T> valueClass) Get the property map with the given name, if it has the given type<T> TracePropertyMap<? extends T> getPropertyMapExtends(String name, Class<T> valueClass) Get the property map with the given name, if its values extend the given type
-
Method Details
-
createPropertyMap
<T> TracePropertyMap<T> createPropertyMap(String name, Class<T> valueClass) throws DuplicateNameException Create a property map with the given name having the given typeThe following types are supported for valueClass:
IntegerLongStringVoid: presence or absence of entry satisfies "boolean" use case? extendsSaveable
Note that for maps of user-defined
Saveabletype, only the specified type is accepted by the map. Attempting to save an extension of that type may lead to undefined behavior, esp., if it attempts to save additional fields. When the value is restored, it will have the type given invalueClass, not the extended type.- Parameters:
name- the namevalueClass- the type of values- Returns:
- the new property map
- Throws:
DuplicateNameException- if a map of the given name already exists
-
getPropertyMap
Get the property map with the given name, if it has the given type- Parameters:
name- the namevalueClass- the expected type of values- Returns:
- the property map, or null if it does not exist
- Throws:
TypeMismatchException- if it exists but does not have the expected type
-
getPropertyMapExtends
Get the property map with the given name, if its values extend the given type- Parameters:
name- the namevalueClass- the expected type of values- Returns:
- the property map, or null if it does not exist
- Throws:
TypeMismatchException- if it exists but does not have the expected type
-
getOrCreatePropertyMap
Get the property map with the given name, creating it if necessary, of the given type- Parameters:
name- the namevalueClass- the expected type of values- Returns:
- the (possibly new) property map
- See Also:
-
getOrCreatePropertyMapSuper
Get the property map with the given name, creating it if necessary, of the given typeIf the map already exists, then its values' type must be a super type of that given.
- Parameters:
name- the namevalueClass- the expected type of values- Returns:
- the (possibly new) property map
- See Also:
-
getPropertyMap
Get the property map with the given name.Note that no type checking is performed (there is no
valueClassparameter). Thus, the returned map is suitable only for clearing and querying where the property is present. The caller may perform run-time type checking via theTracePropertyMapOperations.getValueClass()method.- Parameters:
name- the name- Returns:
- the property map
-
getAllProperties
Map<String,TracePropertyMap<?>> getAllProperties()Get a copy of all the defined properties- Returns:
- the set of names
-