![JAR search and dependency download from the Maven repository](/logo.png)
org.sfm.jdbc.impl.getter.StringEnumResultSetGetter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of simpleFlatMapper Show documentation
Show all versions of simpleFlatMapper Show documentation
Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.
package org.sfm.jdbc.impl.getter;
import org.sfm.reflect.Getter;
import java.sql.ResultSet;
public final class StringEnumResultSetGetter> implements Getter {
private final Class enumType;
private final Getter stringGetter;
public StringEnumResultSetGetter(final Getter stringGetter, final Class enumType) {
this.stringGetter = stringGetter;
this.enumType = enumType;
}
@Override
public E get(final ResultSet target) throws Exception {
final String o = stringGetter.get(target);
return (E) Enum.valueOf(enumType, String.valueOf(o));
}
@Override
public String toString() {
return "StringEnumResultSetGetter{" +
"enumType=" + enumType +
", stringGetter=" + stringGetter +
'}';
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy