package org.simpleflatmapper.map.fieldmapper;
import org.simpleflatmapper.map.FieldMapper;
import org.simpleflatmapper.map.MappingContext;
import org.simpleflatmapper.reflect.primitive.FloatGetter;
import org.simpleflatmapper.reflect.primitive.FloatSetter;
public final class FloatFieldMapper<S, T> implements FieldMapper<S, T> {
private final FloatGetter<? super S> getter;
private final FloatSetter<? super T> setter;
public FloatFieldMapper(final FloatGetter<? super S> getter, final FloatSetter<? super T> setter) {
this.getter = getter;
this.setter = setter;
}
@Override
public void mapTo(final S source, final T target, final MappingContext<? super S> context) throws Exception {
setter.setFloat(target, getter.getFloat(source));
}
@Override
public String toString() {
return "FloatFieldMapper{" +
"getter=" + getter +
", setter=" + setter +
'}';
}
}