com.zhuang.excel.easyexcel.FillItemBuilder Maven / Gradle / Ivy
package com.zhuang.excel.easyexcel;
import java.util.*;
public class FillItemBuilder {
private List fillItemList = new ArrayList<>();
private Map map = new HashMap();
public FillItemBuilder add(String name, Object data) {
fillItemList.add(new FillItem(name, data));
return this;
}
public FillItemBuilder add4Horizontal(String name, Object data) {
fillItemList.add(new HorizontalFillItem(name, data));
return this;
}
public FillItemBuilder set(String key, Object value) {
map.put(key, value);
return this;
}
public List buildList() {
if (map.size() > 0) {
add(null, map);
}
return fillItemList;
}
}