org.simpleflatmapper.map.fieldmapper.ShortConstantTargetFieldMapper 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.fieldmapper;
import org.simpleflatmapper.map.FieldMapper;
import org.simpleflatmapper.map.MappingContext;
import org.simpleflatmapper.map.setter.ShortContextualSetter;
import org.simpleflatmapper.reflect.primitive.ShortGetter;
public final class ShortConstantTargetFieldMapper implements FieldMapper {
private final ShortGetter super S> getter;
private final ShortContextualSetter super T> setter;
public ShortConstantTargetFieldMapper(final ShortGetter super S> getter, final ShortContextualSetter super T> setter) {
this.getter = getter;
this.setter = setter;
}
@Override
public void mapTo(final S source, final T target, final MappingContext super S> mappingContext) throws Exception {
setter.setShort(target, getter.getShort(source), mappingContext);
}
@Override
public String toString() {
return "ShortFieldMapper{" +
"getter=" + getter +
", setter=" + setter +
'}';
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy