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 voiddetermineInitialization(Class type)Functionality called byConverterProviderto determine which class this will be initialized with.voidmapForDb(String name, Collection<T> value, Map<String,Object> map)Adds the value to the map for database processingvoidsetTypeConverter(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:FieldConverterAdds the value to the map for database processing- Specified by:
mapForDbin 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:FieldConverterTransforms from db value to value understood by the java class- Specified by:
toJavaValuein 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:CollectionConverterConverter for the type the list contains- Specified by:
setTypeConverterin interfaceCollectionConverter<T>- Parameters:
typeConverter- to do the conversion
-
determineInitialization
public void determineInitialization(Class type)
Description copied from interface:CollectionConverterFunctionality called byConverterProviderto determine which class this will be initialized with.- Specified by:
determineInitializationin interfaceCollectionConverter<T>- Parameters:
type- for whilc initialization should be determined
-
-