Package org.jppf.utils.collections
Class MetadataImpl
java.lang.Object
org.jppf.utils.collections.MetadataImpl
- All Implemented Interfaces:
Serializable,Metadata
- Direct Known Subclasses:
JPPFJobMetadata,JPPFTaskBundle,MemoryMapDataProvider
- Author:
- Laurent Cohen
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe map holding the mapping of keys to values. -
Constructor Summary
Constructors -
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 defaultValue) 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.toString()
-
Field Details
-
parameters
The map holding the mapping of keys to values.
-
-
Constructor Details
-
MetadataImpl
public MetadataImpl()
-
-
Method Details
-
getParameter
Description copied from interface:MetadataRetrieve a parameter in the metadata.- Specified by:
getParameterin interfaceMetadata- 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
Description copied from interface:MetadataRetrieve a parameter in the metadata.- Specified by:
getParameterin interfaceMetadata- Type Parameters:
T- the type of the value to get.- Parameters:
key- the parameter's key.defaultValue- 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
Description copied from interface:MetadataSet a parameter in the metadata. If a parameter with the same key already exists, its value is replaced with the new one.- Specified by:
setParameterin interfaceMetadata- Parameters:
key- the parameter's key.value- the parameter's value.- Returns:
- this metadata object, for method chaining.
-
removeParameter
Description copied from interface:MetadataRemove a parameter from the metadata.- Specified by:
removeParameterin interfaceMetadata- 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
Description copied from interface:MetadataDetermine whether this metadata container has a parameter with the specified key.- Specified by:
hasParameterin interfaceMetadata- Parameters:
key- the key to lookup in this metadata container.- Returns:
trueif this metadata has an entry with the specified key,falseotherwise.
-
getAll
Description copied from interface:MetadataGet a copy of the metadata map. -
toString
-
clear
Description copied from interface:MetadataClear the underlying map.
-