All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.jinghui70.rainbow.utils.TreeNode Maven / Gradle / Ivy

There is a newer version: 5.2.1
Show newest version
package io.github.jinghui70.rainbow.utils;

import cn.hutool.core.collection.CollUtil;
import io.github.jinghui70.rainbow.dbaccess.annotation.Transient;

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

public class TreeNode> {

    @Transient
    private List children;

    public List getChildren() {
        return children;
    }

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

    public void addChild(T child) {
        if (children == null) {
            children = new ArrayList<>();
        }
        children.add(child);
    }

    public boolean hasChild() {
        return CollUtil.isNotEmpty(children);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy