package com.cm.plugin.map.pojo.dto;

import com.cm.plugin.map.pojo.vo.GridPointVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.ArrayList;
import java.util.List;

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: GridDTO
 * @Description: 网格
 * @Author: WangGeng
 * @Date: 2020/10/21 17:01
 * @Version: 1.0
 **/
@ApiModel
public class GridDTO extends GridRelationDTO {

    @ApiModelProperty(name = "fillColor", value = "填充颜色")
    private String fillColor;
    @ApiModelProperty(name = "gridName", value = "网格名称")
    private String gridName;
    @ApiModelProperty(name = "relationIdArray", value = "关联ID列表")
    private List<String> relationIdArray;
    @ApiModelProperty(name = "pointArray", value = "网格点列表")
    private List<GridPointDTO> pointArray;

    public String getFillColor() {
        return fillColor == null ? "" : fillColor.trim();
    }

    public void setFillColor(String fillColor) {
        this.fillColor = fillColor;
    }

    public String getGridName() {
        return gridName == null ? "" : gridName.trim();
    }

    public void setGridName(String gridName) {
        this.gridName = gridName;
    }

    public List<String> getRelationIdArray() {
        if (relationIdArray == null) {
            return new ArrayList<>();
        }
        return relationIdArray;
    }

    public void setRelationIdArray(List<String> relationIdArray) {
        this.relationIdArray = relationIdArray;
    }

    public List<GridPointDTO> getPointArray() {
        if (pointArray == null) {
            return new ArrayList<>();
        }
        return pointArray;
    }

    public void setPointArray(List<GridPointDTO> pointArray) {
        this.pointArray = pointArray;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"fillColor\":\"")
                .append(fillColor).append('\"');
        sb.append(",\"gridName\":\"")
                .append(gridName).append('\"');
        sb.append(",\"relationIdArray\":")
                .append(relationIdArray);
        sb.append(",\"pointArray\":")
                .append(pointArray);
        sb.append('}');
        return sb.toString();
    }
}
