Class MapConverterImpl<K,V>
- java.lang.Object
-
- science.aist.neo4j.reflective.converter.MapConverterImpl<K,V>
-
- All Implemented Interfaces:
MapConverter<K,V>
,FieldConverter<String,Map<K,V>>
public class MapConverterImpl<K,V> extends Object implements MapConverter<K,V>
Converter that handles arrays- Since:
- 1.0
- Author:
- Oliver Krauss
-
-
Constructor Summary
Constructors Constructor Description MapConverterImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
mapForDb(String name, Map<K,V> value, Map<String,Object> map)
Adds the value to the map for database processingvoid
setKeyConverter(FieldConverter<String,K> keyConverter)
Injects converter to convert a string to a map's key classvoid
setValueConverter(FieldConverter<String,V> valueConverter)
Injects converter to convert a string to a map's value classMap<K,V>
toJavaValue(Map<K,V> currentValue, Object newValue)
Transforms from db value to value understood by the java class
-
-
-
Method Detail
-
mapForDb
public void mapForDb(String name, Map<K,V> value, Map<String,Object> map)
Description copied from interface:FieldConverter
Adds the value to the map for database processing- Specified by:
mapForDb
in interfaceFieldConverter<K,V>
- Parameters:
name
- of fieldvalue
- to be pushed to dbmap
- map the value will be entered in
-
toJavaValue
public Map<K,V> toJavaValue(Map<K,V> currentValue, Object newValue)
Description copied from interface:FieldConverter
Transforms from db value to value understood by the java class- Specified by:
toJavaValue
in interfaceFieldConverter<K,V>
- Parameters:
currentValue
- value the java object has right nownewValue
- db to be transformed- Returns:
- Java value
-
setKeyConverter
public void setKeyConverter(FieldConverter<String,K> keyConverter)
Description copied from interface:MapConverter
Injects converter to convert a string to a map's key class- Specified by:
setKeyConverter
in interfaceMapConverter<K,V>
- Parameters:
keyConverter
- used to convert string
-
setValueConverter
public void setValueConverter(FieldConverter<String,V> valueConverter)
Description copied from interface:MapConverter
Injects converter to convert a string to a map's value class- Specified by:
setValueConverter
in interfaceMapConverter<K,V>
- Parameters:
valueConverter
- used to convert string
-
-