Package | Description |
---|---|
cn.hutool.core.bean |
Bean相关操作,包括Bean信息描述,Bean路径表达式、动态Bean、Bean工具等
|
cn.hutool.core.bean.copier |
Bean拷贝实现,包括拷贝选项等
|
cn.hutool.core.collection |
集合以及Iterator封装,包括集合工具CollUtil,Iterator和Iterable工具IterUtil
|
cn.hutool.core.map |
Map相关封装,提供特殊Map实现以及Map工具MapUtil
|
cn.hutool.core.util |
提供各种工具方法,按照归类入口为XXXUtil,如字符串工具StrUtil等
|
Modifier and Type | Method and Description |
---|---|
static Map<String,Object> |
BeanUtil.beanToMap(Object bean,
Map<String,Object> targetMap,
boolean ignoreNullValue,
Editor<String> keyEditor)
对象转Map
通过实现 Editor 可以自定义字段值,如果这个Editor返回null则忽略这个字段,以便实现: |
Modifier and Type | Field and Description |
---|---|
protected Editor<String> |
CopyOptions.fieldNameEditor
字段属性编辑器,用于自定义属性转换规则,例如驼峰转下划线等
|
Modifier and Type | Method and Description |
---|---|
CopyOptions |
CopyOptions.setFieldNameEditor(Editor<String> fieldNameEditor)
设置字段属性编辑器,用于自定义属性转换规则,例如驼峰转下划线等
此转换器只针对源端的字段做转换,请确认转换后与目标端字段一致 当转换后的字段名为null时忽略这个字段 |
Modifier and Type | Method and Description |
---|---|
static List<Object> |
CollUtil.extract(Iterable<?> collection,
Editor<Object> editor)
通过Editor抽取集合元素中的某些值返回为新列表
例如提供的是一个Bean列表,通过Editor接口实现获取某个字段值,返回这个字段值组成的新列表 |
static List<Object> |
CollUtil.extract(Iterable<?> collection,
Editor<Object> editor,
boolean ignoreNull)
通过Editor抽取集合元素中的某些值返回为新列表
例如提供的是一个Bean列表,通过Editor接口实现获取某个字段值,返回这个字段值组成的新列表 |
static <T> Collection<T> |
CollUtil.filter(Collection<T> collection,
Editor<T> editor)
过滤,此方法产生一个新集合
过滤过程通过传入的Editor实现来返回需要的元素内容,这个Editor实现可以实现以下功能: |
static <T> List<T> |
ListUtil.filter(List<T> list,
Editor<T> editor)
过滤
过滤过程通过传入的Editor实现来返回需要的元素内容,这个Editor实现可以实现以下功能: |
static <T> List<T> |
CollUtil.filter(List<T> list,
Editor<T> editor)
过滤
过滤过程通过传入的Editor实现来返回需要的元素内容,这个Editor实现可以实现以下功能: |
static <K,V> Map<K,V> |
CollUtil.filter(Map<K,V> map,
Editor<Map.Entry<K,V>> editor)
过滤
过滤过程通过传入的Editor实现来返回需要的元素内容,这个Editor实现可以实现以下功能: |
Modifier and Type | Method and Description |
---|---|
static <K,V> Map<K,V> |
MapUtil.filter(Map<K,V> map,
Editor<Map.Entry<K,V>> editor)
过滤
过滤过程通过传入的Editor实现来返回需要的元素内容,这个Editor实现可以实现以下功能: |
Modifier and Type | Method and Description |
---|---|
static <T> void |
ArrayUtil.edit(T[] array,
Editor<T> editor)
编辑数组
编辑过程通过传入的Editor实现来返回需要的元素内容,这个Editor实现可以实现以下功能: |
static <T> T[] |
ArrayUtil.filter(T[] array,
Editor<T> editor)
过滤
过滤过程通过传入的Editor实现来返回需要的元素内容,这个Editor实现可以实现以下功能: |
static <T> String |
ArrayUtil.join(T[] array,
CharSequence conjunction,
Editor<T> editor)
以 conjunction 为分隔符将数组转换为字符串
|
Copyright © 2021. All rights reserved.