com.supwisdom.spreadsheet.mapper.o2w.converter.LambdaPropertyStringifier2 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spreadsheet-mapper-java8 Show documentation
Show all versions of spreadsheet-mapper-java8 Show documentation
Spreadsheet Mapper - Java 8 support
package com.supwisdom.spreadsheet.mapper.o2w.converter;
import com.supwisdom.spreadsheet.mapper.model.core.Row;
import com.supwisdom.spreadsheet.mapper.model.meta.FieldMeta;
import java.util.function.BiFunction;
/**
* 利用java8 lambda表达式的{@link PropertyStringifier}
*
* @param 要转换成{@link com.supwisdom.spreadsheet.mapper.model.core.Row}的Object的类型
*/
public class LambdaPropertyStringifier2 extends PropertyStringifierTemplate {
private BiFunction biFunction;
/**
* lambda表达式
* object:要导出为{@link Row}的object
*
* @param biFunction String function(T object, FieldMeta)
*/
public LambdaPropertyStringifier2(BiFunction biFunction) {
this.biFunction = biFunction;
}
@Override
public String getPropertyString(T object, FieldMeta fieldMeta) {
return biFunction.apply(object, fieldMeta);
}
@Override
protected String convertProperty(Object property) {
return null;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy