All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fastnate.data.csv.CsvEnumConverter Maven / Gradle / Ivy

There is a newer version: 1.5.0
Show newest version
package org.fastnate.data.csv;

/**
 * Converts a string from a CSV file to an Enum value.
 *
 * @author Tobias Liefke
 */
public class CsvEnumConverter implements CsvPropertyConverter> {

	@Override
	@SuppressWarnings("rawtypes")
	public Enum convert(final Class> targetType, final String value) {
		return Enum.valueOf((Class) targetType, value.trim());
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy