package egovframework.util.excel;

import lombok.Getter;

import java.util.List;
import java.util.Map;

@Getter
public class ExcelMetadata {
	private final Map<String, String> excelHeaderNames;
	private final Map<String, Integer> excelHeaderWidths;
	private final List<String> dataFieldNames;
	private final String sheetName;

	public ExcelMetadata(Map<String, String> excelHeaderNames, Map<String, Integer> excelHeaderWidths, List<String> dataFieldNames, String sheetName) {
		this.excelHeaderNames = excelHeaderNames;
		this.excelHeaderWidths = excelHeaderWidths;
		this.dataFieldNames = dataFieldNames;
		this.sheetName = sheetName;
	}

	public String getHeaderName(String fieldName) {
		return excelHeaderNames.getOrDefault(fieldName, "");
	}

	public int getHeaderWidth(String fieldName) {
		return excelHeaderWidths.getOrDefault(fieldName, 0);
	}
}
