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

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

package org.simpleflatmapper.map.fieldmapper;

import org.simpleflatmapper.map.FieldMapper;
import org.simpleflatmapper.map.MappingContext;
import org.simpleflatmapper.reflect.primitive.IntGetter;
import org.simpleflatmapper.reflect.primitive.IntSetter;

public final class IntFieldMapper implements FieldMapper {

	private final IntGetter getter;
	private final IntSetter setter;
	
 	public IntFieldMapper(final IntGetter getter, final IntSetter setter) {
		this.getter = getter;
		this.setter = setter;
	}

	@Override
	public void mapTo(final S source, final T target, final MappingContext mappingContext) throws Exception {
        setter.setInt(target, getter.getInt(source));
	}

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy