com.swak.excel.metadata.ExcelSheetData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of swak-excel-boot-starter Show documentation
Show all versions of swak-excel-boot-starter Show documentation
swak component of excel spring boot starter
The newest version!
package com.swak.excel.metadata;
import com.google.common.collect.Maps;
import com.swak.common.dto.base.DTO;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
public class ExcelSheetData implements DTO {
private Map,SheetRowData> allSheetRow = Maps.newHashMap();
public List getSheetRows(Class clazz) {
SheetRowData sheetRowData = allSheetRow.get(clazz);
if(Objects.nonNull(sheetRowData)) {
return (List) sheetRowData.getExcelRows();
}
return Collections.emptyList();
}
public void addSheetRows(SheetRowData sheetRow) {
allSheetRow.putIfAbsent(sheetRow.getHead(),sheetRow);
}
}