All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.simpleflatmapper.map.fieldmapper.DoubleConstantSourceFieldMapper Maven / Gradle / Ivy

Go to download

Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.

The newest version!
package org.simpleflatmapper.map.fieldmapper;

import org.simpleflatmapper.map.FieldMapper;
import org.simpleflatmapper.map.MappingContext;
import org.simpleflatmapper.map.getter.ContextualGetterAdapter;
import org.simpleflatmapper.map.getter.DoubleContextualGetter;
import org.simpleflatmapper.map.setter.ContextualSetterAdapter;
import org.simpleflatmapper.map.setter.DoubleContextualSetter;
import org.simpleflatmapper.reflect.primitive.DoubleGetter;
import org.simpleflatmapper.reflect.primitive.DoubleSetter;

public final class DoubleConstantSourceFieldMapper implements FieldMapper {

	public final DoubleContextualGetter getter;
	public final DoubleSetter setter;
	
 	public DoubleConstantSourceFieldMapper(final DoubleContextualGetter getter, final DoubleSetter setter) {
		this.getter = getter;
		this.setter = setter;
	}
	@Override
	public void mapTo(final S source, final T target, final MappingContext mappingContext) throws Exception {
		setter.setDouble(target, getter.getDouble(source, mappingContext));
	}

    @Override
    public String toString() {
        return "DoubleFieldMapper{" +
                "getter=" + getter +
                ", setter=" + setter +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy