package com.bonus.canteen.core.common.domain;



import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;
/**
 * @author 19814
 */
@Setter
@Getter
public class BaseTreeNode {
    private Long id;
    private Long parentId;
    private List<BaseTreeNode> children;

    public void addChild(BaseTreeNode baseTreeNode) {
        if (this.children == null) {
            this.setChildren(new ArrayList<>());
        }

        this.getChildren().add(baseTreeNode);
    }

}