org.simpleflatmapper.map.getter.BiInstantiatorContextualGetter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sfm-map Show documentation
Show all versions of sfm-map Show documentation
Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.
package org.simpleflatmapper.map.getter;
import org.simpleflatmapper.converter.Context;
import org.simpleflatmapper.reflect.BiInstantiator;
public class BiInstantiatorContextualGetter implements ContextualGetter {
private final BiInstantiator super S, ? super Context, ? extends T> biInstantiator;
public BiInstantiatorContextualGetter(BiInstantiator super S, ? super Context, ? extends T> biInstantiator) {
this.biInstantiator = biInstantiator;
}
@Override
public T get(S s, Context context) throws Exception {
return biInstantiator.newInstance(s, context);
}
}