// Path: src/main/java/br/com/tecsinapse/dataio/util/WorkbookUtil.java
// public static XSSFColor toXSSFColor(final HSSFColor hssfColor) {
//     return new XSSFColor(Color.decode(StyleColorUtil.toHexColor(hssfColor)), new DefaultIndexedColorMap());
// }


import static br.com.tecsinapse.dataio.util.WorkbookUtil.toXSSFColor;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
        this.left = left;
        this.right = right;
        this.top = top;
        this.bottom = bottom;
    }


    public CellStyle toCellStyle(CellStyle cellStyle) {
        if (cellStyle == null || !left && !right && !bottom && !top) {
            return cellStyle;
        }
        if (left) {
            cellStyle.setBorderLeft(BorderStyle.THIN);
            if (cellStyle instanceof XSSFCellStyle) {
                ((XSSFCellStyle)cellStyle).setLeftBorderColor(toXSSFColor(borderColor));
            } else {
                cellStyle.setLeftBorderColor(borderColor.getIndex());
            }
        }
        if (right) {
            cellStyle.setBorderRight(BorderStyle.THIN);
            if (cellStyle instanceof XSSFCellStyle) {
                ((XSSFCellStyle)cellStyle).setRightBorderColor(toXSSFColor(borderColor));
            } else {
                cellStyle.setRightBorderColor(borderColor.getIndex());
            }
        }
        if (bottom) {
            cellStyle.setBorderBottom(BorderStyle.THIN);
            if (cellStyle instanceof XSSFCellStyle) {
// Path: src/main/java/br/com/tecsinapse/dataio/util/WorkbookUtil.java
// public static XSSFColor toXSSFColor(final HSSFColor hssfColor) {
//     return new XSSFColor(Color.decode(StyleColorUtil.toHexColor(hssfColor)), new DefaultIndexedColorMap());
// }


// Path: src/main/java/br/com/tecsinapse/dataio/style/CellStyleBorder.java
import static br.com.tecsinapse.dataio.util.WorkbookUtil.toXSSFColor;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

        this.left = left;
        this.right = right;
        this.top = top;
        this.bottom = bottom;
    }


    public CellStyle toCellStyle(CellStyle cellStyle) {
        if (cellStyle == null || !left && !right && !bottom && !top) {
            return cellStyle;
        }
        if (left) {
            cellStyle.setBorderLeft(BorderStyle.THIN);
            if (cellStyle instanceof XSSFCellStyle) {
                ((XSSFCellStyle)cellStyle).setLeftBorderColor(toXSSFColor(borderColor));
            } else {
                cellStyle.setLeftBorderColor(borderColor.getIndex());
            }
        }
        if (right) {
            cellStyle.setBorderRight(BorderStyle.THIN);
            if (cellStyle instanceof XSSFCellStyle) {
                ((XSSFCellStyle)cellStyle).setRightBorderColor(toXSSFColor(borderColor));
            } else {
                cellStyle.setRightBorderColor(borderColor.getIndex());
            }
        }
        if (bottom) {
            cellStyle.setBorderBottom(BorderStyle.THIN);
            if (cellStyle instanceof XSSFCellStyle) {
                ((XSSFCellStyle)cellStyle).setBottomBorderColor(toXSSFColor(borderColor));