Package org.jppf.utils.collections
Interface Metadata
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
DataProvider,JobMetadata,TaskBundle
- All Known Implementing Classes:
AbstractNotificationBundle,JPPFJobMetadata,JPPFTaskBundle,MemoryMapDataProvider,MetadataImpl,NotificationBundle
A generic dictionary of metadata.
- Author:
- Laurent Cohen
-
Method Summary
Modifier and TypeMethodDescriptionclear()Clear the underlying map.getAll()Get a copy of the metadata map.<T> TgetParameter(Object key) Retrieve a parameter in the metadata.<T> TgetParameter(Object key, T def) Retrieve a parameter in the metadata.booleanhasParameter(Object key) Determine whether this metadata container has a parameter with the specified key.<T> TremoveParameter(Object key) Remove a parameter from the metadata.setParameter(Object key, Object value) Set a parameter in the metadata.
-
Method Details
-
getParameter
Retrieve a parameter in the metadata.- Type Parameters:
T- the type of the value to get.- Parameters:
key- the parameter's key.- Returns:
- the parameter's value or null if no parameter with the specified key exists.
-
getParameter
Retrieve a parameter in the metadata.- Type Parameters:
T- the type of the value to get.- Parameters:
key- the parameter's key.def- a default value to return if no parameter with the specified key can be found.- Returns:
- the parameter's value or null if no parameter with the specified key exists.
-
setParameter
Set a parameter in the metadata. If a parameter with the same key already exists, its value is replaced with the new one.- Parameters:
key- the parameter's key.value- the parameter's value.- Returns:
- this metadata object, for method chaining.
-
removeParameter
Remove a parameter from the metadata.- Type Parameters:
T- the type of the value to remove.- Parameters:
key- the parameter's key.- Returns:
- the removed parameter's value or null if no parameter with the specified key exists.
-
hasParameter
Determine whether this metadata container has a parameter with the specified key.- Parameters:
key- the key to lookup in this metadata container.- Returns:
trueif this metadata has an entry with the specified key,falseotherwise.
-
getAll
Get a copy of the metadata map.- Returns:
- a map of the metadata contained in this object.
-
clear
Metadata clear()Clear the underlying map.- Returns:
- this metadata object, for method chaining.
-