Class DefaultEntityConverter

java.lang.Object
org.fastnate.data.properties.DefaultEntityConverter
All Implemented Interfaces:
PropertyConverter<Object>

public class DefaultEntityConverter extends Object implements PropertyConverter<Object>
Uses the EntityRegistration to resolve entities by their unique property. If an entity has more than one unique property, one should use UniquePropertyEntityConverter 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 Details

    • DefaultEntityConverter

      public DefaultEntityConverter(EntityRegistration entityRegistration)
      Creates a new DefaultEntityConverter instance.
      Parameters:
      entityRegistration - Used to find the entities.
  • Method Details

    • convert

      public Object convert(Class<? extends Object> targetType, String value)
      Description copied from interface: PropertyConverter
      Converts a value from import file to Java.
      Specified by:
      convert in interface PropertyConverter<Object>
      Parameters:
      targetType - the type of the target property
      value - the value in the import file
      Returns:
      the value in Java