CellValue Type mapping with Apose Current Jar

hi Team,

The celltype value was earlier given as a string with Aspose version 22.8, now its a Enum mapping as per this below link :

Could you please let us know the current mapping for the same for case 1, case 4, case 5 and default

Sample code :

private String getOriginalCellValue(Cell cellItem) {
String cellContent = null;
switch (cellItem.getType()) {
case 1:
cellContent = cellItem.getStringValue();
break;
case 4:
cellContent = cellItem.getStringValueWithoutFormat();
break;
case 5:
cellContent = cellItem.getStringValueWithoutFormat();
break;
default:
cellContent = cellItem.getStringValue();
break;
}
return cellContent;
}

@sr2989,

Please note, CellValueType is an enum which has multiple members. There is no such mapping in it. Moreover, Cell.StringValueWithoutFormat attribute is obsolete and will be removed soon. You may get the value object and format it according to the value type for your requirement. You may use getStringValue() method while specifying CellValueFormatStrategy.

See the sample code segment for your reference.
e.g.,
Sample code:

Workbook workbook = new Workbook("Book1.xlsx");
Worksheet worksheet = workbook.getWorksheets().get(0);
Cell cell = worksheet.getCells().get("A1");
switch (cell.getType()) {
    case com.aspose.cells.CellValueType.IS_BOOL:
        System.out.println("  Boolean Value: " + cell.getBoolValue());
        break;
    case com.aspose.cells.CellValueType.IS_DATE_TIME:
        System.out.println("  Date Value: " + cell.getDateTimeValue());
        break;
    case com.aspose.cells.CellValueType.IS_NUMERIC:
        System.out.println("  Numeric Value: " + cell.getDoubleValue());
        break;
    case com.aspose.cells.CellValueType.IS_STRING:
        System.out.println("  String Value: " + cell.getStringValue(CellValueFormatStrategy.NONE));
        break;
    case com.aspose.cells.CellValueType.IS_NULL:
        System.out.println("  Null Value");
        break;
}

Hope, this helps a bit.