Class DefaultDataChannelMetaData
- java.lang.Object
-
- org.apache.cayenne.configuration.xml.DefaultDataChannelMetaData
-
- All Implemented Interfaces:
DataChannelMetaData
public class DefaultDataChannelMetaData extends Object implements DataChannelMetaData
Default implementation of
DataChannelMetaData
that stores data in Map.This implementation is thread safe.
- Since:
- 4.1
- See Also:
NoopDataChannelMetaData
-
-
Constructor Summary
Constructors Constructor Description DefaultDataChannelMetaData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(ConfigurationNode key, Object value)
value.getClass() will be used under the hood to associate data with the key object.<T> T
get(ConfigurationNode key, Class<T> type)
If either key or value isnull
thennull
will be returned.<T> T
remove(ConfigurationNode key, Class<T> type)
-
-
-
Method Detail
-
add
public void add(ConfigurationNode key, Object value)
value.getClass() will be used under the hood to associate data with the key object.- Specified by:
add
in interfaceDataChannelMetaData
- Parameters:
key
- object for which we want to store datavalue
- data to store
-
get
public <T> T get(ConfigurationNode key, Class<T> type)
If either key or value isnull
thennull
will be returned.- Specified by:
get
in interfaceDataChannelMetaData
- Type Parameters:
T
- data type- Parameters:
key
- object for wich we want meta datatype
- meta data type class- Returns:
- value or
null
-
remove
public <T> T remove(ConfigurationNode key, Class<T> type)
- Specified by:
remove
in interfaceDataChannelMetaData
- Type Parameters:
T
- data type- Parameters:
key
- object for wich we want meta datatype
- meta data type class- Returns:
- removed value or
null
-
-