Class CollectionConverterImpl<T>
- java.lang.Object
-
- science.aist.neo4j.reflective.converter.CollectionConverterImpl<T>
-
- All Implemented Interfaces:
CollectionConverter<T>
,FieldConverter<String,Collection<T>>
public class CollectionConverterImpl<T> extends Object implements CollectionConverter<T>
Default implementation of list converter- Since:
- 1.0
- Author:
- Oliver Krauss
-
-
Constructor Summary
Constructors Constructor Description CollectionConverterImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
determineInitialization(Class type)
Functionality called byConverterProvider
to determine which class this will be initialized with.void
mapForDb(String name, Collection<T> value, Map<String,Object> map)
Adds the value to the map for database processingvoid
setTypeConverter(FieldConverter<String,T> typeConverter)
Converter for the type the list containsCollection<T>
toJavaValue(Collection<T> currentValue, Object newValue)
Transforms from db value to value understood by the java class
-
-
-
Method Detail
-
mapForDb
public void mapForDb(String name, Collection<T> value, Map<String,Object> map)
Description copied from interface:FieldConverter
Adds the value to the map for database processing- Specified by:
mapForDb
in interfaceFieldConverter<String,Collection<T>>
- Parameters:
name
- of fieldvalue
- to be pushed to dbmap
- map the value will be entered in
-
toJavaValue
public Collection<T> toJavaValue(Collection<T> currentValue, Object newValue)
Description copied from interface:FieldConverter
Transforms from db value to value understood by the java class- Specified by:
toJavaValue
in interfaceFieldConverter<String,Collection<T>>
- Parameters:
currentValue
- value the java object has right nownewValue
- db to be transformed- Returns:
- Java value
-
setTypeConverter
public void setTypeConverter(FieldConverter<String,T> typeConverter)
Description copied from interface:CollectionConverter
Converter for the type the list contains- Specified by:
setTypeConverter
in interfaceCollectionConverter<T>
- Parameters:
typeConverter
- to do the conversion
-
determineInitialization
public void determineInitialization(Class type)
Description copied from interface:CollectionConverter
Functionality called byConverterProvider
to determine which class this will be initialized with.- Specified by:
determineInitialization
in interfaceCollectionConverter<T>
- Parameters:
type
- for whilc initialization should be determined
-
-