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

org.simpleflatmapper.csv.getter.CsvLongGetter 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.csv.getter;

import org.simpleflatmapper.converter.Context;
import org.simpleflatmapper.csv.CsvRow;
import org.simpleflatmapper.csv.mapper.CsvRowGetterFactory;
import org.simpleflatmapper.map.getter.ContextualGetter;
import org.simpleflatmapper.map.getter.LongContextualGetter;
import org.simpleflatmapper.map.getter.OptimizableIndexedContextualGetter;

public class CsvLongGetter implements ContextualGetter, LongContextualGetter, OptimizableIndexedContextualGetter {
    public final int index;

    public CsvLongGetter(int index) {
        this.index = index;
    }

    @Override
    public Long get(CsvRow target, Context context)  {
        return CsvLongGetter.this.get(target, context, index);
    }

    public static Long get(CsvRow target, Context context, int index) {
        return target.getLong(index);
    }

    @Override
    public long getLong(CsvRow target, Context context)  {
        return getLong(target, context, index);
    }

    public static long getLong(CsvRow target, Context context, int index) {
        return target.getLong(index);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy