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

com.github.skjolber.stcsv.databinder.column.tri.BooleanCsvFieldMapperTriBuilder Maven / Gradle / Ivy

There is a newer version: 1.0.25
Show newest version
package com.github.skjolber.stcsv.databinder.column.tri;

import com.github.skjolber.stcsv.builder.CsvBuilderException;
import com.github.skjolber.stcsv.databinder.builder.CsvMappingBuilder2;
import com.github.skjolber.stcsv.databinder.builder.SetterProjectionHelper;
import com.github.skjolber.stcsv.databinder.column.bi.BooleanCsvFieldMapperBuilder;
import com.github.skjolber.stcsv.databinder.projection.TriConsumerProjection;
import com.github.skjolber.stcsv.databinder.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);
	}

}






© 2015 - 2024 Weber Informatics LLC | Privacy Policy