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

import java.util.ArrayList;
import java.util.List;

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);
   }

   public Long getId() {
      return this.id;
   }

   public Long getParentId() {
      return this.parentId;
   }

   public List<BaseTreeNode> getChildren() {
      return this.children;
   }

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

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

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

}
