package com.hfkj.model; import java.util.ArrayList; import java.util.List; public class CommonTreeModel { private String text; private Long id; private Long pId; private Integer showOnMobile; private List nodes; public Integer getShowOnMobile() { return showOnMobile; } public void setShowOnMobile(Integer showOnMobile) { this.showOnMobile = showOnMobile; } public String getText() { return text; } public void setText(String text) { this.text = text; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getpId() { return pId; } public void setpId(Long pId) { this.pId = pId; } public List getNodes() { return nodes; } public void setNodes(List nodes) { this.nodes = nodes; } /** * 添加子节点. * @param child */ public void add(CommonTreeModel child) { if (nodes == null) { nodes = new ArrayList<>(); } nodes.add(child); } }