package com.yanzuoguang.excel;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 列设置
 *
 * @author 颜佐光
 */
@ApiModel("合并列")
public class ExportColumn {

    /**
     * 列标题,如 A.B
     */
    @ApiModelProperty(notes = "列标题,如 A.B")
    private String title;

    /**
     * 数据单元格
     */
    @ApiModelProperty(notes = "数据列名称")
    private String name;

    /**
     * 数据是否合并
     */
    @ApiModelProperty(notes = "数据是否合并")
    private boolean merger;

    /**
     * 合并組
     */
    @ApiModelProperty(notes = "合并組")
    private String megerGroup;

    /**
     * 宽度
     */
    @ApiModelProperty(notes = "宽度")
    private short width;

    public ExportColumn() {
    }

    public ExportColumn(String title, String name) {
        this.title = title;
        this.name = name;
    }

    public ExportColumn(String title, String name, short width) {
        this.title = title;
        this.name = name;
        this.width = width;
    }

    public ExportColumn(String title, String name, boolean merger, String megerGroup, short width) {
        this.title = title;
        this.name = name;
        this.merger = merger;
        this.megerGroup = megerGroup;
        this.width = width;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isMerger() {
        return merger;
    }

    public void setMerger(boolean merger) {
        this.merger = merger;
    }

    public String getMegerGroup() {
        return megerGroup;
    }

    public void setMegerGroup(String megerGroup) {
        this.megerGroup = megerGroup;
    }

    public short getWidth() {
        if (this.width < 1) {
            return ExportData.COLUMN_WIDTH;
        }
        return width;
    }

    public void setWidth(short width) {
        this.width = width;
    }
}