我想要更改这些弃用的方法:
if (sheet.getRow(1).getCell(1).getCellType() == XSSFCell.CELL_TYPE_BLANK) {
testSuite = "";
} else if (sheet.getRow(1).getCell(1).getCellType() == XSSFCell.CELL_TYPE_NUMERIC) {
double password1 = sheet.getRow(1).getCell(1).getNumericCellValue();
testSuite = String.valueOf(password1);
} else if (sheet.getRow(1).getCell(1).getCellType() == XSSFCell.CELL_TYPE_STRING) {
testSuite = sheet.getRow(1).getCell(1).getStringCellValue();
} else if (sheet.getRow(1).getCell(1).getCellType() == XSSFCell.CELL_TYPE_FORMULA) {
testSuite = sheet.getRow(1).getCell(1).getStringCellValue();
}
/**
* Return the cell type.
*
* Will return {@link CellType} in a future version of POI.
* For forwards compatibility, do not hard-code cell type literals in your code.
*
* @return the cell type
* @deprecated 3.15. Will return a {@link CellType} enum in the future.
*/
@Override
public int getCellType() {
return getCellTypeEnum().getCode();
}