me.excel.tools.validator.row.CommonRowValidator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-excel-tools Show documentation
Show all versions of java-excel-tools Show documentation
powerful and convenient excel tools
The newest version!
package me.excel.tools.validator.row;
import me.excel.tools.model.excel.ExcelRow;
import java.util.function.Function;
/**
* customer row validator
*
* Created by hanwen on 4/26/16.
*/
public class CommonRowValidator extends RowValidatorAdapter {
private Function validateResultGetter;
public CommonRowValidator(Function validateResultGetter, String errorMessage, String[] messageOnFields) {
super(errorMessage, messageOnFields);
this.validateResultGetter = validateResultGetter;
}
public CommonRowValidator(Function validateResultGetter, String[] messageOnFields) {
super(null, messageOnFields);
this.validateResultGetter = validateResultGetter;
}
@Override
protected boolean customValidate(ExcelRow excelRow) {
if (validateResultGetter == null) {
return true;
}
return validateResultGetter.apply(excelRow);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy