Convert change to ConvertUtil

This commit is contained in:
Looly
2024-08-23 08:36:52 +08:00
parent c6777244a0
commit 3ddad8ff6c
92 changed files with 336 additions and 339 deletions

View File

@@ -19,7 +19,7 @@ package org.dromara.hutool.poi.csv;
import org.dromara.hutool.core.bean.BeanUtil;
import org.dromara.hutool.core.collection.CollUtil;
import org.dromara.hutool.core.collection.iter.ArrayIter;
import org.dromara.hutool.core.convert.Convert;
import org.dromara.hutool.core.convert.ConvertUtil;
import org.dromara.hutool.core.io.IORuntimeException;
import org.dromara.hutool.core.io.IoUtil;
import org.dromara.hutool.core.io.file.FileUtil;
@@ -228,7 +228,7 @@ public final class CsvWriter implements Closeable, Flushable, Serializable {
public CsvWriter write(final Iterable<?> lines) throws IORuntimeException {
if (CollUtil.isNotEmpty(lines)) {
for (final Object values : lines) {
appendLine(Convert.toStrArray(values));
appendLine(ConvertUtil.toStrArray(values));
}
flush();
}
@@ -286,7 +286,7 @@ public final class CsvWriter implements Closeable, Flushable, Serializable {
writeHeaderLine(map.keySet().toArray(new String[0]));
isFirst = false;
}
writeLine(Convert.toStrArray(map.values()));
writeLine(ConvertUtil.toStrArray(map.values()));
}
flush();
}

View File

@@ -17,7 +17,6 @@
package org.dromara.hutool.poi.excel.reader.sheet;
import org.dromara.hutool.core.collection.CollUtil;
import org.dromara.hutool.core.convert.Convert;
import org.apache.poi.ss.usermodel.Sheet;
import org.dromara.hutool.poi.excel.RowUtil;
import org.dromara.hutool.poi.excel.cell.editors.CellEditor;

View File

@@ -19,7 +19,7 @@ package org.dromara.hutool.poi.excel.sax.handler;
import org.dromara.hutool.core.bean.BeanUtil;
import org.dromara.hutool.core.collection.iter.IterUtil;
import org.dromara.hutool.core.collection.ListUtil;
import org.dromara.hutool.core.convert.Convert;
import org.dromara.hutool.core.convert.ConvertUtil;
import org.dromara.hutool.core.lang.Assert;
import java.util.List;
@@ -61,7 +61,7 @@ public abstract class BeanRowHandler<T> extends AbstractRowHandler<T> {
@Override
public void handle(final int sheetIndex, final long rowIndex, final List<Object> rowCells) {
if (rowIndex == this.headerRowIndex) {
this.headerList = ListUtil.view(Convert.toList(String.class, rowCells));
this.headerList = ListUtil.view(ConvertUtil.toList(String.class, rowCells));
return;
}
super.handle(sheetIndex, rowIndex, rowCells);

View File

@@ -18,7 +18,7 @@ package org.dromara.hutool.poi.excel.sax.handler;
import org.dromara.hutool.core.collection.iter.IterUtil;
import org.dromara.hutool.core.collection.ListUtil;
import org.dromara.hutool.core.convert.Convert;
import org.dromara.hutool.core.convert.ConvertUtil;
import java.util.List;
import java.util.Map;
@@ -57,7 +57,7 @@ public abstract class MapRowHandler extends AbstractRowHandler<Map<String, Objec
@Override
public void handle(final int sheetIndex, final long rowIndex, final List<Object> rowCells) {
if (rowIndex == this.headerRowIndex) {
this.headerList = ListUtil.view(Convert.toList(String.class, rowCells));
this.headerList = ListUtil.view(ConvertUtil.toList(String.class, rowCells));
return;
}
super.handle(sheetIndex, rowIndex, rowCells);

View File

@@ -19,7 +19,7 @@ package org.dromara.hutool.poi.word;
import org.dromara.hutool.core.bean.BeanUtil;
import org.dromara.hutool.core.collection.ListUtil;
import org.dromara.hutool.core.collection.iter.IterUtil;
import org.dromara.hutool.core.convert.Convert;
import org.dromara.hutool.core.convert.ConvertUtil;
import org.dromara.hutool.core.lang.Assert;
import org.dromara.hutool.core.map.MapUtil;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
@@ -147,7 +147,7 @@ public class TableUtil {
int index = 0;
for (final Object cellData : rowData) {
cell = getOrCreateCell(row, index);
cell.setText(Convert.toStr(cellData));
cell.setText(ConvertUtil.toStr(cellData));
index++;
}
}

View File

@@ -14,7 +14,7 @@ package org.dromara.hutool.poi.excel.reader;
import org.dromara.hutool.core.collection.CollUtil;
import org.dromara.hutool.core.collection.ListUtil;
import org.dromara.hutool.core.convert.Convert;
import org.dromara.hutool.core.convert.ConvertUtil;
import org.dromara.hutool.core.io.IoUtil;
import org.dromara.hutool.core.io.file.FileUtil;
import org.dromara.hutool.core.lang.Console;
@@ -93,7 +93,7 @@ public class ExcelSaxReadTest {
@Disabled
public void readBlankLineTest() {
ExcelUtil.readBySax("e:/ExcelBlankLine.xlsx", 0, (sheetIndex, rowIndex, rowList) -> {
if (StrUtil.isAllEmpty(Convert.toStrArray(rowList))) {
if (StrUtil.isAllEmpty(ConvertUtil.toStrArray(rowList))) {
return;
}
Console.log(rowList);