mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add methods
This commit is contained in:
parent
6002a1476f
commit
ca0e66d9b4
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加节点列表,增加的节点是不带子节点的
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user