package com.sunxung.factoring.entity.sys.vo;

import java.util.List;

import com.sunxung.factoring.entity.sys.Permission;

public class PermissionTreeNode {

    private Long id;
    private String name;
    private String roleId;
    private Boolean isParent = true;
    private boolean open = true;// 节点能否打开
    private boolean checked = false;// 节点勾选
    private List<PermissionTreeNode> children;

    public PermissionTreeNode(){
    }

    public PermissionTreeNode(Permission per){
        this.id = per.getId();
        this.name = per.getCname();
        this.isParent = per.getCount() > 0 ? true : false;
        this.checked = per.isCheck() == true ? true : false;
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public Long getId() {
        return id;
    }

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

    public String getName() {
        return name;
    }

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

    public Boolean getIsParent() {
        return isParent;
    }

    public void setIsParent(Boolean isParent) {
        this.isParent = isParent;
    }

    public boolean isOpen() {
        return open;
    }

    public void setOpen(boolean open) {
        this.open = open;
    }

    public boolean isChecked() {
        return checked;
    }

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

    public List<PermissionTreeNode> getChildren() {
        return children;
    }

    public void setChildren(List<PermissionTreeNode> children) {
        this.children = children;
    }
}
