org.simpleflatmapper.csv.getter.CsvBooleanGetter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sfm-csv Show documentation
Show all versions of sfm-csv Show documentation
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.map.getter.BooleanContextualGetter;
import org.simpleflatmapper.map.getter.ContextualGetter;
import org.simpleflatmapper.map.getter.OptimizableIndexedContextualGetter;
public class CsvBooleanGetter implements ContextualGetter, BooleanContextualGetter, OptimizableIndexedContextualGetter {
public final int index;
public CsvBooleanGetter(int index) {
this.index = index;
}
@Override
public Boolean get(CsvRow target, Context context) {
return get(target, context, index);
}
public static boolean get(CsvRow target, Context context, int index) {
return target.getBoolean(index);
}
@Override
public boolean getBoolean(CsvRow target, Context context) {
return getBoolean(target, context, index);
}
public static boolean getBoolean(CsvRow target, Context context, int index) {
return target.getBoolean(index);
}
}