package ru.ulstu.core.model;

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

public class TreeDto {
    private Integer id;
    private String text;
    private List<TreeDto> children = new ArrayList<>();

    public TreeDto() {
    }

    public <T extends TreeEntity> TreeDto(TreeEntity item) {
        this.text = item.toString();
        this.id = item.getId();
    }

    public TreeDto(String rootName) {
        this.text = rootName;
    }

    public String getText() {
        return text;
    }

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

    public Integer getId() {
        return id;
    }
}
