org.simpleflatmapper.converter.impl.CharSequenceToEnumConverter Maven / Gradle / Ivy
package org.simpleflatmapper.converter.impl;
import org.simpleflatmapper.converter.Converter;
public class CharSequenceToEnumConverter> implements Converter {
private final Class enumClass;
public CharSequenceToEnumConverter(Class enumClass) {
this.enumClass = enumClass;
}
@Override
public E convert(CharSequence in) throws Exception {
if (in == null) return null;
return Enum.valueOf(enumClass, in.toString());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy