package com.zsc.edu.gateway.domain;

import com.zsc.edu.gateway.modules.system.entity.Dept;

import java.util.HashSet;
import java.util.List;

public class DeptBuilder extends BaseEntityBuilder {

    public String name;
    public Dept parent;
    public Long pid;

    public HashSet<Dept> children;


    public static DeptBuilder aDept(){
        return new DeptBuilder();
    }

    public DeptBuilder name(String name){
        this.name = name;
        return this;
    }


    public DeptBuilder parent(Dept parent) {
        this.parent = parent;
        return this;
    }

    public DeptBuilder pid(Long pid) {
        this.pid = pid;
        return this;
    }

    public DeptBuilder children(HashSet<Dept> children) {
        this.children = children;
        return this;
    }


    public Dept build(){
        Dept dept = new Dept();
        dept.setName(name);
        dept.setPid(pid);
        dept.setChildren((List<Dept>) children);
        return dept;
    }


}
