com.github.skjolber.stcsv.column.tri.BooleanCsvFieldMapperTriBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of databinder Show documentation
Show all versions of databinder Show documentation
High-performance CSV databinding library
package com.github.skjolber.stcsv.column.tri;
import com.github.skjolber.stcsv.builder.CsvBuilderException;
import com.github.skjolber.stcsv.builder.CsvMappingBuilder2;
import com.github.skjolber.stcsv.builder.SetterProjectionHelper;
import com.github.skjolber.stcsv.column.bi.BooleanCsvFieldMapperBuilder;
import com.github.skjolber.stcsv.projection.TriConsumerProjection;
import com.github.skjolber.stcsv.projection.ValueProjection;
public class BooleanCsvFieldMapperTriBuilder> extends BooleanCsvFieldMapperBuilder {
protected ObjBooleanTriConsumer triConsumer;
protected Class intermediate;
public BooleanCsvFieldMapperTriBuilder(B parent, String name, Class intermediate) {
super(parent, name);
this.intermediate = intermediate;
}
public BooleanCsvFieldMapperTriBuilder consumer(ObjBooleanTriConsumer consumer) {
this.triConsumer = consumer;
return this;
}
protected ValueProjection getProjection(int index, SetterProjectionHelper proxy) throws CsvBuilderException {
if(triConsumer != null) {
return new TriConsumerProjection(new BooleanCsvColumnValueTriConsumer<>(triConsumer), index);
}
return super.getProjection(index, proxy);
}
}