shz.paper.excel.ExcelData Maven / Gradle / Ivy
package shz.paper.excel;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import shz.core.NullHelp;
import shz.core.ToMap;
import java.util.Collections;
import java.util.Map;
import java.util.function.Function;
public final class ExcelData {
public int sheetIndex;
public Sheet sheet;
public int rowIndex;
public Row row;
public Map data;
public Map getStringData() {
if (NullHelp.isEmpty(data)) return Collections.emptyMap();
return ToMap.explicitCollect(
data.keySet().stream(),
Function.identity(),
key -> ExcelHelp.getCellValue(data.get(key)),
data.size()
);
}
public int getSheetIndex() {
return sheetIndex;
}
public void setSheetIndex(int sheetIndex) {
this.sheetIndex = sheetIndex;
}
public Sheet getSheet() {
return sheet;
}
public void setSheet(Sheet sheet) {
this.sheet = sheet;
}
public int getRowIndex() {
return rowIndex;
}
public void setRowIndex(int rowIndex) {
this.rowIndex = rowIndex;
}
public Row getRow() {
return row;
}
public void setRow(Row row) {
this.row = row;
}
public Map getData() {
return data;
}
public void setData(Map data) {
this.data = data;
}
@Override
public String toString() {
return "ExcelData{" +
"sheetIndex=" + sheetIndex +
", sheet=" + sheet +
", rowIndex=" + rowIndex +
", row=" + row +
", data=" + data +
'}';
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy