add methods

This commit is contained in:
Looly 2021-09-29 10:51:44 +08:00
parent 6002a1476f
commit ca0e66d9b4
2 changed files with 62 additions and 0 deletions

View File

@ -14,6 +14,7 @@
* 【core 】 增加IterableIter、ComputeIter
* 【core 】 CsvConfig增加disableComment方法issue#1842@Github
* 【core 】 DateTime构造和DateUtil.parse可选是否宽松模式issue#1849@Github
* 【core 】 TreeBuilder增加部分根节点set方法issue#1848@Github
### 🐞Bug修复
* 【http 】 修复HttpCookie设置cookies的方法不符合RFC6265规范问题pr#418@Gitee

View File

@ -59,6 +59,67 @@ public class TreeBuilder<E> implements Builder<Tree<E>> {
this.idTreeMap = new HashMap<>();
}
/**
* 设置ID
*
* @param id ID
* @return this
* @since 5.7.14
*/
public TreeBuilder<E> setId(E id) {
this.root.setId(id);
return this;
}
/**
* 设置父节点ID
*
* @param parentId 父节点ID
* @return this
* @since 5.7.14
*/
public TreeBuilder<E> setParentId(E parentId) {
this.root.setParentId(parentId);
return this;
}
/**
* 设置节点标签名称
*
* @param name 节点标签名称
* @return this
* @since 5.7.14
*/
public TreeBuilder<E> setName(CharSequence name) {
this.root.setName(name);
return this;
}
/**
* 设置权重
*
* @param weight 权重
* @return this
* @since 5.7.14
*/
public TreeBuilder<E> setWeight(Comparable<?> weight) {
this.root.setWeight(weight);
return this;
}
/**
* 扩展属性
*
* @param key
* @param value 扩展值
* @since 5.7.14
*/
public TreeBuilder<E> putExtra(String key, Object value) {
Assert.notEmpty(key, "Key must be not empty !");
this.root.put(key, value);
return this;
}
/**
* 增加节点列表增加的节点是不带子节点的
*