Package | Description |
---|---|
cn.hutool.core.collection |
集合以及Iterator封装,包括集合工具CollUtil,Iterator和Iterable工具IterUtil
|
cn.hutool.core.io.watch |
基于JDK7+ WatchService的文件和目录监听封装,支持多级目录
|
cn.hutool.core.lang |
语言特性包,包括大量便捷的数据结构,例如验证器Validator,分布式ID生成器Snowflake等
|
cn.hutool.core.lang.copier |
拷贝抽象实现,通过抽象拷贝,可以实现文件、流、Buffer之间的拷贝实现
|
cn.hutool.core.map |
Map相关封装,提供特殊Map实现以及Map工具MapUtil
|
cn.hutool.core.net |
网络相关工具
|
cn.hutool.core.text |
提供文本相关操作的封装,还包括Unicode工具UnicodeUtil
|
cn.hutool.core.util |
提供各种工具方法,按照归类入口为XXXUtil,如字符串工具StrUtil等
|
cn.hutool.dfa |
DFA全称为:Deterministic Finite Automaton,即确定有穷自动机。
解释起来原理其实也不难,就是用所有关键字构造一棵树,然后用正文遍历这棵树,遍历到叶子节点即表示文章中存在这个关键字。 我们暂且忽略构建关键词树的时间,每次查找正文只需要O(n)复杂度就可以搞定。 |
cn.hutool.extra.compress.archiver |
基于commons-compress的打包(压缩)封装
|
cn.hutool.extra.compress.extractor |
基于commons-compress的解包(解压缩)封装
|
cn.hutool.extra.ftp |
基于Apache Commons Net封装的FTP工具
|
cn.hutool.extra.ssh |
Jsch封装,包括端口映射、SFTP封装等,入口为JschUtil
|
Modifier and Type | Method and Description |
---|---|
static <E> Iterator<E> |
IterUtil.filter(Iterator<E> iter,
Filter<E> filter)
过滤集合,此方法在原集合上直接修改
通过实现Filter接口,完成元素的过滤,这个Filter实现可以实现以下功能: |
static <K,V> Map<K,V> |
CollUtil.filter(Map<K,V> map,
Filter<Map.Entry<K,V>> filter)
过滤
过滤过程通过传入的Editor实现来返回需要的元素内容,这个Editor实现可以实现以下功能: |
static <T extends Iterable<E>,E> |
IterUtil.filter(T iter,
Filter<E> filter)
过滤集合,此方法在原集合上直接修改
通过实现Filter接口,完成元素的过滤,这个Filter实现可以实现以下功能: |
static <T extends Collection<E>,E> |
CollUtil.filter(T collection,
Filter<E> filter)
去除指定元素,此方法直接修改原集合
|
static <T> Collection<T> |
CollUtil.filterNew(Collection<T> collection,
Filter<T> filter)
过滤
过滤过程通过传入的Filter实现来过滤返回需要的元素内容,这个Filter实现可以实现以下功能: |
static <T> List<T> |
CollUtil.filterNew(List<T> list,
Filter<T> filter)
过滤
过滤过程通过传入的Filter实现来过滤返回需要的元素内容,这个Filter实现可以实现以下功能: |
static <T> T |
CollUtil.findOne(Iterable<T> collection,
Filter<T> filter)
查找第一个匹配元素对象
|
Modifier and Type | Method and Description |
---|---|
void |
WatchServer.watch(WatchAction action,
Filter<WatchEvent<?>> watchFilter)
执行事件获取并处理
|
void |
WatchServer.watch(Watcher watcher,
Filter<WatchEvent<?>> watchFilter)
执行事件获取并处理
|
Modifier and Type | Method and Description |
---|---|
static Set<Class<?>> |
ClassScanner.scanPackage(String packageName,
Filter<Class<?>> classFilter)
扫描包路径下满足class过滤器条件的所有class文件,
如果包路径为 com.abs + A.class 但是输入 abs会产生classNotFoundException 因为className 应该为 com.abs.A 现在却成为abs.A,此工具类对该异常进行忽略处理 |
Constructor and Description |
---|
ClassScanner(String packageName,
Filter<Class<?>> classFilter)
构造,默认UTF-8编码
|
ClassScanner(String packageName,
Filter<Class<?>> classFilter,
Charset charset)
构造
|
Modifier and Type | Field and Description |
---|---|
protected Filter<T> |
SrcToDestCopier.copyFilter
拷贝过滤器,可以过滤掉不需要拷贝的源
|
Modifier and Type | Method and Description |
---|---|
Filter<T> |
SrcToDestCopier.getCopyFilter()
获得过滤器
|
Modifier and Type | Method and Description |
---|---|
C |
SrcToDestCopier.setCopyFilter(Filter<T> copyFilter)
设置过滤器
|
Modifier and Type | Method and Description |
---|---|
static <K,V> Map<K,V> |
MapUtil.filter(Map<K,V> map,
Filter<Map.Entry<K,V>> filter)
过滤
过滤过程通过传入的Editor实现来返回需要的元素内容,这个Filter实现可以实现以下功能: |
Modifier and Type | Method and Description |
---|---|
static LinkedHashSet<InetAddress> |
NetUtil.localAddressList(Filter<InetAddress> addressFilter)
获取所有满足过滤条件的本地IP地址对象
|
Modifier and Type | Method and Description |
---|---|
static String |
CharSequenceUtil.filter(CharSequence str,
Filter<Character> filter)
过滤字符串
|
Modifier and Type | Method and Description |
---|---|
static String |
EscapeUtil.escape(CharSequence content,
Filter<Character> filter)
Escape编码(Unicode)
该方法不会对 ASCII 字母和数字进行编码。其他所有的字符都会被转义序列替换。 |
static <T> T[] |
ArrayUtil.filter(T[] array,
Filter<T> filter)
过滤
过滤过程通过传入的Filter实现来过滤返回需要的元素内容,这个Filter实现可以实现以下功能: |
static Method[] |
ReflectUtil.getMethods(Class<?> clazz,
Filter<Method> filter)
获得指定类过滤后的Public方法列表
|
static List<Method> |
ReflectUtil.getPublicMethods(Class<?> clazz,
Filter<Method> filter)
获得指定类过滤后的Public方法列表
|
static List<Method> |
ClassUtil.getPublicMethods(Class<?> clazz,
Filter<Method> filter)
获得指定类过滤后的Public方法列表
|
static Set<Class<?>> |
ClassUtil.scanPackage(String packageName,
Filter<Class<?>> classFilter)
扫面包路径下满足class过滤器条件的所有class文件,
如果包路径为 com.abs + A.class 但是输入 abs会产生classNotFoundException 因为className 应该为 com.abs.A 现在却成为abs.A,此工具类对该异常进行忽略处理,有可能是一个不完善的地方,以后需要进行修改 |
Modifier and Type | Method and Description |
---|---|
static void |
SensitiveUtil.setCharFilter(Filter<Character> charFilter)
设置字符过滤规则,通过定义字符串过滤规则,过滤不需要的字符
当accept为false时,此字符不参与匹配 |
WordTree |
WordTree.setCharFilter(Filter<Character> charFilter)
设置字符过滤规则,通过定义字符串过滤规则,过滤不需要的字符
当accept为false时,此字符不参与匹配 |
Modifier and Type | Method and Description |
---|---|
default Archiver |
Archiver.add(File file,
Filter<File> filter)
将文件或目录加入归档,目录采取递归读取方式按照层级加入
|
Archiver |
Archiver.add(File file,
String path,
Filter<File> filter)
将文件或目录加入归档包,目录采取递归读取方式按照层级加入
|
StreamArchiver |
StreamArchiver.add(File file,
String path,
Filter<File> filter)
将文件或目录加入归档包,目录采取递归读取方式按照层级加入
|
SevenZArchiver |
SevenZArchiver.add(File file,
String path,
Filter<File> filter) |
Modifier and Type | Method and Description |
---|---|
void |
Extractor.extract(File targetDir,
Filter<org.apache.commons.compress.archivers.ArchiveEntry> filter)
释放(解压)到指定目录,结束后自动关闭流,此方法只能调用一次
|
void |
StreamExtractor.extract(File targetDir,
Filter<org.apache.commons.compress.archivers.ArchiveEntry> filter)
释放(解压)到指定目录,结束后自动关闭流,此方法只能调用一次
|
void |
SenvenZExtractor.extract(File targetDir,
Filter<org.apache.commons.compress.archivers.ArchiveEntry> filter)
释放(解压)到指定目录,结束后自动关闭流,此方法只能调用一次
|
Modifier and Type | Method and Description |
---|---|
List<org.apache.commons.net.ftp.FTPFile> |
Ftp.lsFiles(String path,
Filter<org.apache.commons.net.ftp.FTPFile> filter)
遍历某个目录下所有文件和目录,不会递归遍历
此方法自动过滤"."和".."两种目录 |
Modifier and Type | Method and Description |
---|---|
List<String> |
Sftp.ls(String path,
Filter<com.jcraft.jsch.ChannelSftp.LsEntry> filter)
遍历某个目录下所有文件或目录,不会递归遍历
此方法自动过滤"."和".."两种目录 |
List<com.jcraft.jsch.ChannelSftp.LsEntry> |
Sftp.lsEntries(String path,
Filter<com.jcraft.jsch.ChannelSftp.LsEntry> filter)
遍历某个目录下所有文件或目录,生成LsEntry列表,不会递归遍历
此方法自动过滤"."和".."两种目录 |
Copyright © 2021. All rights reserved.