package com.lightinit.hsdataportal.model;

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

/**
 * Created by WangYao on 2018/5/29.
 */
public class TreeModel implements Serializable {

    private String id;
    private String parentId;
    private String text;
    private Integer level;
    private List<TreeModel> nodes = new ArrayList<TreeModel>();

//    bootstrap-treeview 参数
    private String icon;
    private String selectedIcon;
    private String href;
    /*private Boolean selectable = true;*/
    private State state;
    private String color;
    private String backColor;
    private List<String> tags;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public List<TreeModel> getNodes() {
        return nodes;
    }

    public void setNodes(List<TreeModel> nodes) {
        this.nodes = nodes;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getSelectedIcon() {
        return selectedIcon;
    }

    public void setSelectedIcon(String selectedIcon) {
        this.selectedIcon = selectedIcon;
    }

    public String getHref() {
        return href;
    }

    public void setHref(String href) {
        this.href = href;
    }

    /*public Boolean getSelectable() {
        return selectable;
    }

    public void setSelectable(Boolean selectable) {
        this.selectable = selectable;
    }*/

    public State getState() {
        return state;
    }

    public void setState(State state) {
        this.state = state;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getBackColor() {
        return backColor;
    }

    public void setBackColor(String backColor) {
        this.backColor = backColor;
    }

    public List<String> getTags() {
        return tags;
    }

    public void setTags(List<String> tags) {
        this.tags = tags;
    }

    public TreeModel(){}

    public TreeModel(String id, String parentId, String text, Integer level, List<TreeModel> nodes, String icon, String selectedIcon, String href/*, Boolean selectable*/, State state, String color, String backColor, List<String> tags){
        this.id = id;
        this.parentId = parentId;
        this.text = text;
        this.level = level;
        this.nodes = nodes;
        this.icon = icon;
        this.selectedIcon = selectedIcon;
        this.href = href;
        /*this.selectable = selectable;*/
        this.state = state;
        this.color = color;
        this.backColor = backColor;
        this.tags = tags;
    }

    public TreeModel(String id, String parentId, String text, Integer level){
        this(id, parentId, text, level, null, null, null, null/*, null*/, null, null, null, null);
    }

    public TreeModel(String id, String parentId, String text, Integer level, List<TreeModel> nodes){
        this(id, parentId, text, level, nodes, null, null, null/*, null*/, null, null, null, null);
    }

    public TreeModel(String id, String parentId, String text, Integer level, String href, List<String> tags){
        this(id, parentId, text, level, null, null, null, href/*, null*/, null, null, null, tags);
    }

    public class State {

        Boolean checked = false;
        Boolean disabled = false;
        Boolean expanded = false;
        Boolean selected = false;

        public Boolean getChecked() {
            return checked;
        }

        public void setChecked(Boolean checked) {
            this.checked = checked;
        }

        public Boolean getDisabled() {
            return disabled;
        }

        public void setDisabled(Boolean disabled) {
            this.disabled = disabled;
        }

        public Boolean getExpanded() {
            return expanded;
        }

        public void setExpanded(Boolean expanded) {
            this.expanded = expanded;
        }

        public Boolean getSelected() {
            return selected;
        }

        public void setSelected(Boolean selected) {
            this.selected = selected;
        }

        public State(){}

        public State(Boolean checked, Boolean disabled, Boolean expanded, Boolean selected){
            this.checked = checked;
            this.disabled = disabled;
            this.expanded = expanded;
            this.selected = selected;
        }
    }
}
