pl.net.bluesoft.rnd.pt.utils.jdbc.convert.ResultSetValueConverter Maven / Gradle / Ivy
package pl.net.bluesoft.rnd.pt.utils.jdbc.convert;
import java.lang.reflect.ParameterizedType;
public abstract class ResultSetValueConverter {
protected Class type;
protected ResultSetValueConverter() {
this.type = (Class) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];
}
protected ResultSetValueConverter(Class clazz) {
this.type = clazz;
}
public boolean supports(Class clazz) {
return type.isAssignableFrom(clazz);
}
public abstract T convert(Object value, Class propertyType);
}