org.simpleflatmapper.converter.AbstractContextualConverterFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sfm-converter Show documentation
Show all versions of sfm-converter Show documentation
Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.
package org.simpleflatmapper.converter;
import java.lang.reflect.Type;
public abstract class AbstractContextualConverterFactory implements ContextualConverterFactory {
protected final ConvertingTypes convertingTypes;
protected AbstractContextualConverterFactory(Class super I> from, Class extends O> to) {
this(new ConvertingTypes(from, to));
}
protected AbstractContextualConverterFactory(ConvertingTypes convertingTypes) {
this.convertingTypes = convertingTypes;
}
@Override
public ConvertingScore score(ConvertingTypes targetedTypes) {
return this.convertingTypes.score(targetedTypes);
}
@Override
public Type getFromType() {
return this.convertingTypes.getFrom();
}
}