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

org.simpleflatmapper.converter.DefaultContextFactoryBuilder 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.converter;

import org.simpleflatmapper.util.Supplier;

import java.util.ArrayList;

public final class DefaultContextFactoryBuilder implements ContextFactoryBuilder {
    
    
    private final ArrayList> suppliers = new ArrayList>();
    
    public DefaultContextFactoryBuilder(){
    }
    
    @Override
    public int addSupplier(Supplier supplier) {
        int index = suppliers.size();
        suppliers.add(supplier);
        return index;
    }

    @Override
    public ContextFactory build() {
        return suppliers.isEmpty() ? EmptyContextFactory.INSTANCE : new DefaultContextFactory(suppliers.toArray(new Supplier[0]));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy