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

org.simpleflatmapper.map.mapper.MapperSourceImpl 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.mapper;

import org.simpleflatmapper.map.FieldKey;
import org.simpleflatmapper.map.getter.ContextualGetterFactory;
import org.simpleflatmapper.map.getter.ContextualGetterFactoryAdapter;
import org.simpleflatmapper.reflect.getter.GetterFactory;

public class MapperSourceImpl> implements MapperSource {

    private final Class source;
    private final ContextualGetterFactory getterFactory;

    public MapperSourceImpl(Class source, ContextualGetterFactory getterFactory) {
        this.source = source;
        this.getterFactory = getterFactory;
    }

    @Override
    public Class source() {
        return source;
    }

    @Override
    public ContextualGetterFactory getterFactory() {
        return getterFactory;
    }

    public MapperSourceImpl getterFactory(ContextualGetterFactory getterFactory) {
        return new MapperSourceImpl(source, getterFactory);
    }

    public MapperSourceImpl getterFactory(GetterFactory getterFactory) {
        return new MapperSourceImpl(source, new ContextualGetterFactoryAdapter(getterFactory));
    }

}