Package org.openehealth.ipf.commons.map
Interface MappingService
-
- All Known Implementing Classes:
BidiMappingService
,SpringBidiMappingService
public interface MappingService
Interface for mapping a set of keysets into corresponding values.The back end mapping implementation is not defined by this interface. Examples could be a simple
Map
or a remote terminology service, for which proper implementations of this interface must be provided.- Author:
- Christian Ohr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Object
get(Object mappingKey, Object key)
Object
get(Object mappingKey, Object key, Object defaultValue)
Object
getKey(Object mappingKey, Object value)
Reverse mapping (Optional implementation)Object
getKey(Object mappingKey, Object value, Object defaultKey)
Reverse mapping (Optional implementation)Object
getKeySystem(Object mappingKey)
Object
getValueSystem(Object mappingKey)
Set<?>
keys(Object mappingKey)
Set<?>
mappingKeys()
Collection<?>
values(Object mappingKey)
-
-
-
Method Detail
-
get
Object get(Object mappingKey, Object key)
- Parameters:
mappingKey
- mapping namekey
- left side of the mapping- Returns:
- the value mapped by a registered mapping. The implementation of the mapping implements the behavior if the key does not exist.
- Throws:
IllegalArgumentException
- if the mappingKey is not registered.
-
get
Object get(Object mappingKey, Object key, Object defaultValue)
- Parameters:
mappingKey
- mapping namekey
- left side of the mappingdefaultValue
- default right side if there is no mapping for the code- Returns:
- the value mapped by a registered mapping. If no mapping exists, the default value if returned. The implementation of the mapping implements the behavior if the key does not exist.
- Throws:
IllegalArgumentException
- if the mappingKey is not registered.
-
getKey
Object getKey(Object mappingKey, Object value)
Reverse mapping (Optional implementation)- Parameters:
mappingKey
- mapping namevalue
- right side of the mapping- Returns:
- the key mapped by a registered mapping. The implementation of the mapping implements the behavior if the value does not exist.
- Throws:
IllegalArgumentException
- if the mappingKey is not registered.
-
getKey
Object getKey(Object mappingKey, Object value, Object defaultKey)
Reverse mapping (Optional implementation)- Parameters:
mappingKey
- mapping namevalue
- right side of the mappingdefaultKey
- default left side- Returns:
- the key mapped by a registered mapping. If no mapping exists, the default value if returned. The implementation of the mapping implements the behavior if the key does not exist.
- Throws:
IllegalArgumentException
- if the mappingKey is not registered.
-
getKeySystem
Object getKeySystem(Object mappingKey)
- Parameters:
mappingKey
- mapping name- Returns:
- a formal identification of the key system (e.g. an OID)
- Throws:
IllegalArgumentException
- if the mappingKey is not registered.
-
getValueSystem
Object getValueSystem(Object mappingKey)
- Parameters:
mappingKey
- mapping name- Returns:
- a formal identification of the value system (e.g. an OID)
- Throws:
IllegalArgumentException
- if the mappingKey is not registered.
-
mappingKeys
Set<?> mappingKeys()
- Returns:
- a set of names of all registered mappings. Changes to the set do not change the registry itself.
-
keys
Set<?> keys(Object mappingKey)
- Parameters:
mappingKey
- mapping key- Returns:
- key set of a registered mapping. Changes to the set do not change the registry itself.
- Throws:
IllegalArgumentException
- if the mappingKey is not registered.
-
values
Collection<?> values(Object mappingKey)
- Parameters:
mappingKey
- mapping key- Returns:
- value set of a registered mapping. Changes to the set do not change the registry itself.
- Throws:
IllegalArgumentException
- if the mappingKey is not registered.
-
-