ObjectUtil 新增三个 defaultIfXxx 方法

This commit is contained in:
王良
2022-01-13 14:58:20 +08:00
parent c5673bb06b
commit b4cf5ec9e2
20 changed files with 73 additions and 23 deletions

View File

@@ -376,7 +376,7 @@ public class CellUtil {
public static Cell getMergedRegionCell(Sheet sheet, int x, int y) {
return ObjectUtil.defaultIfNull(
getCellIfMergedRegion(sheet, x, y),
SheetUtil.getCell(sheet, y, x));
() -> SheetUtil.getCell(sheet, y, x));
}
/**

View File

@@ -294,7 +294,7 @@ public class SheetDataSaxHandler extends DefaultHandler {
final int numFmtIndex = xssfCellStyle.getDataFormat();
this.numFmtString = ObjectUtil.defaultIfNull(
xssfCellStyle.getDataFormatString(),
BuiltinFormats.getBuiltinFormat(numFmtIndex));
() -> BuiltinFormats.getBuiltinFormat(numFmtIndex));
if (CellDataType.NUMBER == this.cellDataType && ExcelSaxUtil.isDateFormat(numFmtIndex, numFmtString)) {
cellDataType = CellDataType.DATE;
}