package com.engine.htsc.payment.pojo;

import org.apache.commons.lang3.StringUtils;

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

/**
 * it项目 modle
 */
public class TreeNode implements Serializable {

	private static final long serialVersionUID = -2030747144145653088L;

	private String id;
	private String name;
	private String projectCode;
	private String type;
	private List<TreeNode> children;
	private String pid;
	private String pCode;
	private String pName;
	private String key;

	public TreeNode() {
	}

	public TreeNode(String id, String name, String projectCode, String type, List<TreeNode> children, String pid, String pCode, String pName, String key) {
		this.id = id;
		this.name = name;
		this.projectCode = projectCode;
		this.type = type;
		this.children = children;
		this.pid = pid;
		this.pCode = pCode;
		this.pName = pName;
		this.key = key;
	}

	public String getId() {
		return id;
	}

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

	public String getName() {
		return name;
	}

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

	public String getProjectCode() {
		return projectCode;
	}

	public void setProjectCode(String projectCode) {
		this.projectCode = projectCode;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

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

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

	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}

	public String getpCode() {
		return pCode;
	}

	public void setpCode(String pCode) {
		this.pCode = pCode;
	}

	public String getpName() {
		return pName;
	}

	public void setpName(String pName) {
		this.pName = pName;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	@Override
	public String toString() {
		return "TreeNode{" +
				"id='" + id + '\'' +
				", name='" + name + '\'' +
				", projectCode='" + projectCode + '\'' +
				", type='" + type + '\'' +
				", children=" + children +
				", pid='" + pid + '\'' +
				", pCode='" + pCode + '\'' +
				", pName='" + pName + '\'' +
				", key='" + key + '\'' +
				'}';
	}

	public boolean qualify() {
		return !StringUtils.isBlank(name) && !StringUtils.isBlank(projectCode)
				&& !StringUtils.isBlank(type) && !StringUtils.isBlank(key);
	}
}
