org.sfm.map.impl.fieldmapper.LongFieldMapper 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.map.impl.fieldmapper;
import org.sfm.map.FieldMapper;
import org.sfm.map.MappingContext;
import org.sfm.reflect.primitive.LongGetter;
import org.sfm.reflect.primitive.LongSetter;
public final class LongFieldMapper implements FieldMapper {
private final LongGetter getter;
private final LongSetter setter;
public LongFieldMapper(final LongGetter getter, final LongSetter setter) {
this.getter = getter;
this.setter = setter;
}
@Override
public void mapTo(final S source, final T target, final MappingContext mappingContext) throws Exception {
setter.setLong(target, getter.getLong(source));
}
@Override
public String toString() {
return "LongFieldMapper{" +
"getter=" + getter +
", setter=" + setter +
'}';
}
}