package com.cm.common.plugin.pojo.dtos.datadictionary;

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

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: DictionaryDTO
 * @Description: 字典
 * @Author: WangGeng
 * @Date: 2019/11/18 14:17
 * @Version: 1.0
 **/
@ApiModel
public class DataDictionaryDTO implements Serializable {

    @ApiModelProperty(name = "dictionaryId", value = "字典ID")
    private String dictionaryId;
    @ApiModelProperty(name = "dictionaryParentId", value = "字典上级ID")
    private String dictionaryParentId;
    @ApiModelProperty(name = "dictionaryParentName", value = "字典上级名称")
    private String dictionaryParentName;
    @ApiModelProperty(name = "isParent", value = "是否父级")
    private Boolean isParent;
    @ApiModelProperty(name = "dictionaryName", value = "字典名称")
    private String dictionaryName;
    @ApiModelProperty(name = "dictionarySummary", value = "字典说明")
    private String dictionarySummary;
    @ApiModelProperty(name = "dictionaryCode", value = "字典编码")
    private String dictionaryCode;
    @ApiModelProperty(name = "dictionarySort", value = "字典排序")
    private String dictionarySort;
    @ApiModelProperty(name = "subDictionary", value = "子字典列表")
    private List<DataDictionaryDTO> subDictionary;

    public String getDictionaryId() {
        return dictionaryId == null ? "" : dictionaryId;
    }

    public void setDictionaryId(String dictionaryId) {
        this.dictionaryId = dictionaryId;
    }

    public String getDictionaryParentId() {
        return dictionaryParentId == null ? "" : dictionaryParentId;
    }

    public void setDictionaryParentId(String dictionaryParentId) {
        this.dictionaryParentId = dictionaryParentId;
    }

    public String getDictionaryParentName() {
        return dictionaryParentName == null ? "" : dictionaryParentName;
    }

    public void setDictionaryParentName(String dictionaryParentName) {
        this.dictionaryParentName = dictionaryParentName;
    }

    public Boolean getParent() {
        return isParent;
    }

    public void setParent(Boolean parent) {
        isParent = parent;
    }

    public String getDictionaryName() {
        return dictionaryName == null ? "" : dictionaryName;
    }

    public void setDictionaryName(String dictionaryName) {
        this.dictionaryName = dictionaryName;
    }

    public String getDictionarySummary() {
        return dictionarySummary == null ? "" : dictionarySummary;
    }

    public void setDictionarySummary(String dictionarySummary) {
        this.dictionarySummary = dictionarySummary;
    }

    public String getDictionaryCode() {
        return dictionaryCode == null ? "" : dictionaryCode;
    }

    public void setDictionaryCode(String dictionaryCode) {
        this.dictionaryCode = dictionaryCode;
    }

    public String getDictionarySort() {
        return dictionarySort == null ? "" : dictionarySort.trim();
    }

    public void setDictionarySort(String dictionarySort) {
        this.dictionarySort = dictionarySort;
    }

    public List<DataDictionaryDTO> getSubDictionary() {
        if (subDictionary == null) {
            return new ArrayList<>();
        }
        return subDictionary;
    }

    public void setSubDictionary(List<DataDictionaryDTO> subDictionary) {
        this.subDictionary = subDictionary;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"dictionaryId\":")
                .append("\"").append(dictionaryId).append("\"");
        sb.append(",\"dictionaryParentId\":")
                .append("\"").append(dictionaryParentId).append("\"");
        sb.append(",\"dictionaryParentName\":")
                .append("\"").append(dictionaryParentName).append("\"");
        sb.append(",\"isParent\":")
                .append(isParent);
        sb.append(",\"dictionaryName\":")
                .append("\"").append(dictionaryName).append("\"");
        sb.append(",\"dictionarySummary\":")
                .append("\"").append(dictionarySummary).append("\"");
        sb.append(",\"dictionaryCode\":")
                .append("\"").append(dictionaryCode).append("\"");
        sb.append(",\"dictionarySort\":")
                .append("\"").append(dictionarySort).append("\"");
        sb.append(",\"subDictionary\":")
                .append(subDictionary);
        sb.append('}');
        return sb.toString();
    }
}
