com.github.stupdit1t.excel.common.PoiResult Maven / Gradle / Ivy
package com.github.stupdit1t.excel.common;
import java.util.Collections;
import java.util.List;
/**
* excel 导入返回的实体类
*
* @param
* @author 625
*/
public class PoiResult {
private boolean success = true;
private List message = Collections.emptyList();
private List data;
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public List getMessage() {
return message;
}
public String getMessageToString() {
return String.join("\n", message);
}
public void setMessage(List message) {
this.message = message;
}
public List getData() {
return data;
}
public void setData(List beans) {
this.data = beans;
}
public static PoiResult fail() {
PoiResult poiResult = new PoiResult<>();
poiResult.setSuccess(false);
poiResult.setMessage(Collections.singletonList("读取Excel失败"));
poiResult.setData(Collections.emptyList());
return poiResult;
}
}