Package | Description |
---|---|
org.dromara.hutool.core.annotation |
注解包,提供增强型注解和注解工具类,处理包括:
注解元素(AnnotatedElement)上的注解。 |
org.dromara.hutool.core.bean.copier |
Bean拷贝实现,包括拷贝选项等
|
org.dromara.hutool.core.collection |
集合以及Iterator封装,包括集合工具CollUtil,Iterator和Iterable工具IterUtil
|
org.dromara.hutool.core.func |
函数封装
接口灵感来自于ActFramework 一个函数接口代表一个一个函数,用于包装一个函数为对象 在JDK8之前,Java的函数并不能作为参数传递,也不能作为返回值存在,此接口用于将一个函数包装成为一个对象,从而传递对象 |
org.dromara.hutool.core.io.file |
对文件读写的封装,包括文件拷贝、文件读取、文件写出、行处理等
|
org.dromara.hutool.core.lang |
语言特性包,包括大量便捷的数据结构,包括:
ANSI:ANSI编码
Builder:构建器
Caller:查找调用者
Copier:拷贝(复制)
Generator:生成器
Getter:getXXX抽象
Intern:规范化表示形式
Loader:加载器的抽象
Mutable:可变值对象封装
Range:区间和边界封装
Tuple:元组
|
org.dromara.hutool.core.map |
Map相关封装,提供特殊Map实现以及Map工具MapUtil
|
org.dromara.hutool.core.regex |
正则表达式相关封装
|
org.dromara.hutool.core.text |
提供文本相关操作的封装,还包括Unicode工具UnicodeUtil
|
org.dromara.hutool.core.tree |
提供通用树生成,特点:
1、每个字段可自定义
2、支持排序 树深度配置,自定义转换器等 3、支持额外属性扩展 4、贴心 许多属性,特性都有默认值处理 5、使用简单 可一行代码生成树 6、代码简洁轻量无额外依赖 |
org.dromara.hutool.core.util |
提供各种工具方法,按照归类入口为XXXUtil,如字符串工具StrUtil等
|
org.dromara.hutool.db |
Hutool-db是一个在JDBC基础上封装的数据库操作工具类,通过包装,使用ActiveRecord思想操作数据库。
|
org.dromara.hutool.db.sql |
SQL语句和Statement构建封装
|
org.dromara.hutool.json |
JSON(JavaScript Object Notation JavaScript对象表示法)封装
规范见:https://www.rfc-editor.org/rfc/rfc8259 包含以下组件: JSONObject: 使用键值对表示的数据类型,使用"{}"包围 JSONArray: 使用列表表示的数据类型,使用"[]"包围 JSONPrimitive:表示boolean、String、Number等原始类型 JSON封装主要包括JSON表示和JSON转换:
<-----JSONMapper----- <---JSONParser----
Java对象 <====================> JSON对象 <=================> JSON字符串
-----JSONMapper-----> ---JSONWriter---->
当然,为了高效转换,如果没有自定义需求,Java对象可以不通过JSON对象与JSON字符串转换:
JSONTokener:JSON字符串底层解析器,通过Stream方式读取JSON字符串并对不同字段自定义处理。 |
org.dromara.hutool.setting |
Setting模块主要针对Properties文件读写做封装,同时定义一套自己的配置文件规范,实现兼容性良好的配置工具。
|
org.dromara.hutool.setting.props |
配置文件实现封装,例如Properties封装Props
|
Modifier and Type | Method and Description |
---|---|
static <A extends Annotation,R> |
AnnotationUtil.getAnnotationValue(AnnotatedElement annotationEle,
SerFunction<A,R> propertyName)
获取指定注解属性的值
如果无指定的属性方法返回null |
Modifier and Type | Method and Description |
---|---|
<P,R> CopyOptions |
CopyOptions.setIgnoreProperties(SerFunction<P,R>... funcs)
设置忽略的目标对象中属性列表,设置一个属性列表,不拷贝这些属性值,Lambda方式
|
Modifier and Type | Method and Description |
---|---|
static <E,K,V> Map<K,List<V>> |
CollStreamUtil.groupKeyValue(Collection<E> collection,
SerFunction<E,K> key,
SerFunction<E,V> value)
将collection按照规则(比如有相同的班级id)分组成map,map中的key为班级id,value为班级名
Collection<E> -------> Map<K,List<V>> |
static <E,K,V> Map<K,List<V>> |
CollStreamUtil.groupKeyValue(Collection<E> collection,
SerFunction<E,K> key,
SerFunction<E,V> value)
将collection按照规则(比如有相同的班级id)分组成map,map中的key为班级id,value为班级名
Collection<E> -------> Map<K,List<V>> |
static <E,K,V> Map<K,List<V>> |
CollStreamUtil.groupKeyValue(Collection<E> collection,
SerFunction<E,K> key,
SerFunction<E,V> value,
boolean isParallel)
将collection按照规则(比如有相同的班级id)分组成map,map中的key为班级id,value为班级名
Collection<E> -------> Map<K,List<V>> |
static <E,K,V> Map<K,List<V>> |
CollStreamUtil.groupKeyValue(Collection<E> collection,
SerFunction<E,K> key,
SerFunction<E,V> value,
boolean isParallel)
将collection按照规则(比如有相同的班级id)分组成map,map中的key为班级id,value为班级名
Collection<E> -------> Map<K,List<V>> |
static <V,K> Map<K,V> |
CollStreamUtil.toIdentityMap(Collection<V> collection,
SerFunction<V,K> key)
将collection转化为类型不变的map
Collection<V> ----> Map<K,V> |
static <V,K> Map<K,V> |
CollStreamUtil.toIdentityMap(Collection<V> collection,
SerFunction<V,K> key,
boolean isParallel)
将collection转化为类型不变的map
Collection<V> ----> Map<K,V> |
Modifier and Type | Method and Description |
---|---|
static <T> SerFunction<T,T> |
SerFunction.identity()
Returns a function that always returns its input argument.
|
Modifier and Type | Method and Description |
---|---|
default <V> SerBiFunction<T,U,V> |
SerBiFunction.andThen(SerFunction<? super R,? extends V> after)
Returns a composed function that first applies this function to
its input, and then applies the
after function to the result. |
Modifier and Type | Method and Description |
---|---|
static <T> T |
FileUtil.read(File file,
Charset charset,
SerFunction<BufferedReader,T> readerHandler)
按照给定的readerHandler读取文件中的数据
|
<T> T |
FileReader.read(SerFunction<BufferedReader,T> readerHandler)
按照给定的readerHandler读取文件中的数据
|
static <T> T |
FileUtil.read(String path,
Charset charset,
SerFunction<BufferedReader,T> readerHandler)
按照给定的readerHandler读取文件中的数据
|
static <T> T |
FileUtil.readUtf8(File file,
SerFunction<BufferedReader,T> readerHandler)
按照给定的readerHandler读取文件中的数据
|
static <T> T |
FileUtil.readUtf8(String path,
SerFunction<BufferedReader,T> readerHandler)
按照给定的readerHandler读取文件中的数据
|
Modifier and Type | Method and Description |
---|---|
<U> Opt<U> |
Opt.flattedMap(SerFunction<? super T,? extends Optional<? extends U>> mapper)
如果包裹里的值存在,就执行传入的操作(
Function.apply(T) )并返回该操作返回值
如果不存在,返回一个空的Opt
和 Opt.map(org.dromara.hutool.core.func.SerFunction<? super T, ? extends U>) 的区别为 传入的操作返回值必须为 Optional |
<U> Opt<U> |
Opt.map(SerFunction<? super T,? extends U> mapper)
|
Modifier and Type | Method and Description |
---|---|
<P,T> T |
Dict.get(SerFunction<P,T> func)
根据lambda的方法引用,获取
|
Modifier and Type | Method and Description |
---|---|
static String |
ReUtil.replaceAll(CharSequence str,
Pattern pattern,
SerFunction<Matcher,String> replaceFun)
替换所有正则匹配的文本,并使用自定义函数决定如何替换
replaceFun可以通过 Matcher 提取出匹配到的内容的不同部分,然后经过重新处理、组装变成新的内容放回原位。 |
static String |
ReUtil.replaceAll(CharSequence str,
String regex,
SerFunction<Matcher,String> replaceFun)
替换所有正则匹配的文本,并使用自定义函数决定如何替换
replaceFun可以通过 Matcher 提取出匹配到的内容的不同部分,然后经过重新处理、组装变成新的内容放回原位。 |
Modifier and Type | Method and Description |
---|---|
static String |
CharSequenceUtil.replace(CharSequence str,
Pattern pattern,
SerFunction<Matcher,String> replaceFun)
替换所有正则匹配的文本,并使用自定义函数决定如何替换
replaceFun可以提取出匹配到的内容的不同部分,然后经过重新处理、组装变成新的内容放回原位。 |
static String |
CharSequenceUtil.replace(CharSequence str,
String regex,
SerFunction<Matcher,String> replaceFun)
替换所有正则匹配的文本,并使用自定义函数决定如何替换
|
Modifier and Type | Method and Description |
---|---|
SerFunction<T,List<T>> |
LambdaTreeNodeConfig.getChildrenKeyFun()
获取子节点名称方法
|
SerFunction<T,R> |
LambdaTreeNodeConfig.getIdKeyFun()
获取ID方法
|
SerFunction<T,CharSequence> |
LambdaTreeNodeConfig.getNameKeyFun()
获取节点名称方法
|
SerFunction<T,R> |
LambdaTreeNodeConfig.getParentIdKeyFun()
获取父ID方法
|
SerFunction<T,Comparable<?>> |
LambdaTreeNodeConfig.getWeightKeyFun()
设置权重方法
|
Modifier and Type | Method and Description |
---|---|
static <T,R extends Comparable<R>> |
BeanTree.of(SerFunction<T,R> idGetter,
SerFunction<T,R> pidGetter,
R pidValue,
SerFunction<T,List<T>> childrenGetter,
SerBiConsumer<T,List<T>> childrenSetter)
构建BeanTree
|
static <T,R extends Comparable<R>> |
BeanTree.of(SerFunction<T,R> idGetter,
SerFunction<T,R> pidGetter,
R pidValue,
SerFunction<T,List<T>> childrenGetter,
SerBiConsumer<T,List<T>> childrenSetter)
构建BeanTree
|
static <T,R extends Comparable<R>> |
BeanTree.of(SerFunction<T,R> idGetter,
SerFunction<T,R> pidGetter,
R pidValue,
SerFunction<T,List<T>> childrenGetter,
SerBiConsumer<T,List<T>> childrenSetter)
构建BeanTree
|
static <T,R extends Comparable<R>> |
BeanTree.ofMatch(SerFunction<T,R> idGetter,
SerFunction<T,R> pidGetter,
SerPredicate<T> parentPredicate,
SerFunction<T,List<T>> childrenGetter,
SerBiConsumer<T,List<T>> childrenSetter)
构建BeanTree
|
static <T,R extends Comparable<R>> |
BeanTree.ofMatch(SerFunction<T,R> idGetter,
SerFunction<T,R> pidGetter,
SerPredicate<T> parentPredicate,
SerFunction<T,List<T>> childrenGetter,
SerBiConsumer<T,List<T>> childrenSetter)
构建BeanTree
|
static <T,R extends Comparable<R>> |
BeanTree.ofMatch(SerFunction<T,R> idGetter,
SerFunction<T,R> pidGetter,
SerPredicate<T> parentPredicate,
SerFunction<T,List<T>> childrenGetter,
SerBiConsumer<T,List<T>> childrenSetter)
构建BeanTree
|
LambdaTreeNodeConfig<T,R> |
LambdaTreeNodeConfig.setChildrenKeyFun(SerFunction<T,List<T>> childrenKeyFun)
设置子节点名称方法
|
LambdaTreeNodeConfig<T,R> |
LambdaTreeNodeConfig.setIdKeyFun(SerFunction<T,R> idKeyFun)
设置ID方法
|
LambdaTreeNodeConfig<T,R> |
LambdaTreeNodeConfig.setNameKeyFun(SerFunction<T,CharSequence> nameKeyFun)
设置节点名称方法
|
LambdaTreeNodeConfig<T,R> |
LambdaTreeNodeConfig.setParentIdKeyFun(SerFunction<T,R> parentIdKeyFun)
设置父ID方法
|
LambdaTreeNodeConfig<T,R> |
LambdaTreeNodeConfig.setWeightKeyFun(SerFunction<T,Comparable<?>> weightKeyFun)
设置权重方法
|
Modifier and Type | Method and Description |
---|---|
static <E extends Enum<E>,C> |
EnumUtil.getBy(Class<E> enumClass,
SerFunction<E,C> condition,
C value,
E defaultEnum)
通过 某字段对应值 获取 枚举,获取不到时为
defaultEnum |
static <E extends Enum<E>,C> |
EnumUtil.getBy(SerFunction<E,C> condition,
C value)
通过 某字段对应值 获取 枚举,获取不到时为
null |
static <E extends Enum<E>,C> |
EnumUtil.getBy(SerFunction<E,C> condition,
C value,
E defaultEnum)
通过 某字段对应值 获取 枚举,获取不到时为
defaultEnum |
static <E extends Enum<E>,F,C> |
EnumUtil.getFieldBy(SerFunction<E,F> field,
Function<E,C> condition,
C value)
通过 某字段对应值 获取 枚举中另一字段值,获取不到时为
null |
Modifier and Type | Method and Description |
---|---|
<T> T |
AbstractDb.query(SerFunction<Connection,PreparedStatement> statementFunc,
RsHandler<T> rsh)
|
Modifier and Type | Method and Description |
---|---|
<T> T |
SqlExecutor.query(SerFunction<Connection,PreparedStatement> statementFunc,
RsHandler<T> rsh)
|
Modifier and Type | Method and Description |
---|---|
<P,T> T |
JSONObject.get(SerFunction<P,T> func)
根据lambda的方法引用,获取
|
Modifier and Type | Method and Description |
---|---|
<P,T> T |
AbsSetting.get(SerFunction<P,T> func)
根据lambda的方法引用,获取
|
Modifier and Type | Method and Description |
---|---|
<P,T> T |
Props.get(SerFunction<P,T> func)
根据lambda的方法引用,获取
|
Copyright © 2025. All rights reserved.