Package org.fastnate.data.properties
Class UniquePropertyEntityConverter
java.lang.Object
org.fastnate.data.properties.UniquePropertyEntityConverter
- All Implemented Interfaces:
PropertyConverter<Object>
Uses the
EntityRegistration to resolve entities by a specific unique property.
If an entity has exactly one unique property, one can use DefaultEntityConverter instead.
If an entity has no unique property or some other kind of key is used as reference in the CSV files, one can use
MapConverter.- Author:
- Tobias Liefke
-
Constructor Summary
ConstructorsConstructorDescriptionUniquePropertyEntityConverter(EntityRegistration entityRegistration, String uniqueProperty) Creates a newUniquePropertyEntityConverterinstance. -
Method Summary
-
Constructor Details
-
UniquePropertyEntityConverter
Creates a newUniquePropertyEntityConverterinstance.- Parameters:
entityRegistration- Used to find the entities.uniqueProperty- The name of the unique properties.
-
-
Method Details
-
convert
Description copied from interface:PropertyConverterConverts a value from import file to Java.- Specified by:
convertin interfacePropertyConverter<Object>- Parameters:
targetType- the type of the target propertyvalue- the value in the import file- Returns:
- the value in Java
-