| Package | Description |
|---|---|
| org.aoju.bus.core.toolkit |
工具包,提供各种工具方法,按照归类入口为XXXKit,如数组工具ArrayKit等
|
| Modifier and Type | Method and Description |
|---|---|
static <T> String |
LambdaKit.getMethodName(Func1<T,?> func)
获取lambda表达式函数(方法)名称
|
static String |
StringKit.replace(CharSequence text,
Pattern pattern,
Func1<Matcher,String> replaceFun)
替换所有正则匹配的文本,并使用自定义函数决定如何替换
replaceFun可以通过
Matcher提取出匹配到的内容的不同部分,然后经过重新处理、组装变成新的内容放回原位。
replace(this.content, "(\\d+)", parameters -> "-" + parameters.group(1) + "-")
// 结果为:"ZZZaaabbbccc中文-1234-" |
static String |
StringKit.replace(CharSequence text,
String regex,
Func1<Matcher,String> replaceFun)
替换所有正则匹配的文本,并使用自定义函数决定如何替换
|
static String |
PatternKit.replaceAll(CharSequence text,
Pattern pattern,
Func1<Matcher,String> replaceFun)
替换所有正则匹配的文本,并使用自定义函数决定如何替换
replaceFun可以通过
Matcher提取出匹配到的内容的不同部分,然后经过重新处理、组装变成新的内容放回原位。
replaceAll(this.content, "(\\d+)", parameters -> "-" + parameters.group(1) + "-")
结果:"ZZZaaabbbccc中文-1234-" |
static String |
PatternKit.replaceAll(CharSequence text,
String regex,
Func1<Matcher,String> replaceFun)
替换所有正则匹配的文本,并使用自定义函数决定如何替换
replaceFun可以通过
Matcher提取出匹配到的内容的不同部分,然后经过重新处理、组装变成新的内容放回原位。
replaceAll(this.content, "(\\d+)", parameters -> "-" + parameters.group(1) + "-")
结果:"ZZZaaabbbccc中文-1234-" |
static <T> SerializedLambda |
LambdaKit.resolve(Func1<T,?> func)
解析lambda表达式,加了缓存。
该缓存可能会在任意不定的时间被清除
|
static <K,V,E> Map<K,V> |
IterKit.toMap(Iterator<E> iterator,
Map<K,V> map,
Func1<E,K> keyFunc,
Func1<E,V> valueFunc)
集合转换为Map,转换规则为:
按照keyFunc函数规则根据元素对象生成Key,按照valueFunc函数规则根据元素对象生成value组成新的Map
|
static <K,V,E> Map<K,V> |
IterKit.toMap(Iterator<E> iterator,
Map<K,V> map,
Func1<E,K> keyFunc,
Func1<E,V> valueFunc)
集合转换为Map,转换规则为:
按照keyFunc函数规则根据元素对象生成Key,按照valueFunc函数规则根据元素对象生成value组成新的Map
|
static <K,V> Map<K,V> |
IterKit.toMap(Iterator<V> iterator,
Map<K,V> map,
Func1<V,K> keyFunc)
Iterator转换为Map,转换规则为:
按照keyFunc函数规则根据元素对象生成Key,元素作为值
|
Copyright © 2021. All rights reserved.