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

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

Go to download

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

There is a newer version: 9.0.2
Show newest version
package org.simpleflatmapper.map.fieldmapper;

import org.simpleflatmapper.map.FieldMapper;
import org.simpleflatmapper.map.MappingContext;
import org.simpleflatmapper.map.getter.ByteContextualGetter;
import org.simpleflatmapper.map.getter.ContextualGetterAdapter;
import org.simpleflatmapper.map.setter.ByteContextualSetter;
import org.simpleflatmapper.map.setter.ContextualSetterAdapter;
import org.simpleflatmapper.reflect.primitive.ByteGetter;
import org.simpleflatmapper.reflect.primitive.ByteSetter;

public final class ByteConstantSourceFieldMapper implements FieldMapper {

	public final ByteContextualGetter getter;
	public final ByteSetter setter;
	
 	public ByteConstantSourceFieldMapper(final ByteContextualGetter getter, final ByteSetter setter) {
		this.getter = getter;
		this.setter = setter;
	}
	
	@Override
	public void mapTo(final S source, final T target, MappingContext mappingContext) throws Exception {
        setter.setByte(target, getter.getByte(source, mappingContext));
	}

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy