org.fastnate.data.csv.CsvEnumConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fastnate-data Show documentation
Show all versions of fastnate-data Show documentation
The Fastnate Data Importer for offline SQL generation
package org.fastnate.data.csv;
/**
* Converts a string from a CSV file to an Enum value.
*
* @author Tobias Liefke
*/
public final class CsvEnumConverter implements CsvPropertyConverter> {
@Override
@SuppressWarnings("rawtypes")
public Enum> convert(final Class extends Enum>> targetType, final String value) {
return Enum.valueOf((Class) targetType, value.trim());
}
}