org.simpleflatmapper.map.setter.ContextualIndexedSetterAdapter 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.
The newest version!
package org.simpleflatmapper.map.setter;
import org.simpleflatmapper.converter.Context;
import org.simpleflatmapper.reflect.IndexedSetter;
public class ContextualIndexedSetterAdapter implements ContextualIndexedSetter {
private final IndexedSetter setter;
public ContextualIndexedSetterAdapter(IndexedSetter setter) {
this.setter = setter;
}
public static ContextualIndexedSetter of(IndexedSetter indexedSetter) {
if (indexedSetter == null) return null;
return new ContextualIndexedSetterAdapter(indexedSetter);
}
@Override
public void set(T target, P value, int index, Context context) throws Exception {
setter.set(target, value, index);
}
}