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

org.simpleflatmapper.map.setter.ContextualIndexedSetterAdapter 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.setter;

import org.simpleflatmapper.converter.Context;
import org.simpleflatmapper.reflect.IndexedSetter;

public class ContextualIndexedSetterAdapter implements ContextualIndexedSetter {
    
    private final IndexedSetter setter;

    public ContextualIndexedSetterAdapter(IndexedSetter setter) {
        this.setter = setter;
    }

    public static  ContextualIndexedSetter of(IndexedSetter indexedSetter) {
        if (indexedSetter == null) return null;
        return new ContextualIndexedSetterAdapter(indexedSetter);
    }

    @Override
    public void set(T target, P value, int index, Context context) throws Exception {
        setter.set(target, value, index);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy