Top 15 Java Utility Classes
In Java, a utility class is a class that defines a set of methods that perform common functions. This post shows the most frequently used Java utility classes and their most commonly used methods. Both the class list and their method list are ordered by popularity. The data is based on randomly selected 50,000 open source Java projects from GitHub.
Hopefully, you can get a basic idea of what are already provided and popular by browsing the list so that you know you don't need to program it by yourself. The names of the methods normally indicate their functions. You may also click on the methods to see how they are used in open source projects.
1. org.apache.commons.io.IOUtils
- closeQuietly ( )
- toString ( )
- copy ( )
- toByteArray ( )
- write ( )
- toInputStream ( )
- readLines ( )
- copyLarge ( )
- lineIterator ( )
- readFully ( )
2. org.apache.commons.io.FileUtils
- deleteDirectory ( )
- readFileToString ( )
- deleteQuietly ( )
- copyFile ( )
- writeStringToFile ( )
- forceMkdir ( )
- write ( )
- listFiles ( )
- copyDirectory ( )
- forceDelete ( )
3. org.apache.commons.lang.StringUtils
- isBlank ( )
- isNotBlank ( )
- isEmpty ( )
- isNotEmpty ( )
- equals ( )
- join ( )
- split ( )
- EMPTY
- trimToNull ( )
- replace ( )
4. org.apache.http.util.EntityUtils
5. org.apache.commons.lang3.StringUtils
- isBlank ( )
- isNotBlank ( )
- isEmpty ( )
- isNotEmpty ( )
- join ( )
- equals ( )
- split ( )
- EMPTY
- replace ( )
- capitalize ( )
6. org.apache.commons.io.FilenameUtils
- getExtension ( )
- getBaseName ( )
- getName ( )
- concat ( )
- removeExtension ( )
- normalize ( )
- wildcardMatch ( )
- separatorsToUnix ( )
- getFullPath ( )
- isExtension ( )
7. org.springframework.util.StringUtils
- hasText ( )
- hasLength ( )
- isEmpty ( )
- commaDelimitedListToStringArray ( )
- collectionToDelimitedString ( )
- replace ( )
- delimitedListToStringArray ( )
- uncapitalize ( )
- collectionToCommaDelimitedString ( )
- tokenizeToStringArray ( )
8. org.apache.commons.lang.ArrayUtils
- contains ( )
- addAll ( )
- clone ( )
- isEmpty ( )
- add ( )
- EMPTY_BYTE_ARRAY
- subarray ( )
- indexOf ( )
- isEquals ( )
- toObject ( )
9. org.apache.commons.lang.StringEscapeUtils
- escapeHtml ( )
- unescapeHtml ( )
- escapeXml ( )
- escapeSql ( )
- unescapeJava ( )
- escapeJava ( )
- escapeJavaScript ( )
- unescapeXml ( )
- unescapeJavaScript ( )
10. org.apache.http.client.utils.URLEncodedUtils
11. org.apache.commons.codec.digest.DigestUtils
12. org.apache.commons.collections.CollectionUtils
- isEmpty ( )
- isNotEmpty ( )
- select ( )
- transform ( )
- filter ( )
- find ( )
- collect ( )
- forAllDo ( )
- addAll ( )
- isEqualCollection ( )
13. org.apache.commons.lang3.ArrayUtils
- contains ( )
- isEmpty ( )
- isNotEmpty ( )
- add ( )
- clone ( )
- addAll ( )
- subarray ( )
- indexOf ( )
- EMPTY_OBJECT_ARRAY
- EMPTY_STRING_ARRAY
14. org.apache.commons.beanutils.PropertyUtils
- getProperty ( )
- setProperty ( )
- getPropertyDescriptors ( )
- isReadable ( )
- copyProperties ( )
- getPropertyDescriptor ( )
- getSimpleProperty ( )
- isWriteable ( )
- setSimpleProperty ( )
- getPropertyType ( )
15. org.apache.commons.lang3.StringEscapeUtils
- unescapeHtml4 ( )
- escapeHtml4 ( )
- escapeXml ( )
- unescapeXml ( )
- escapeJava ( )
- escapeEcmaScript ( )
- unescapeJava ( )
- escapeJson ( )
- escapeXml10 ( )
16. org.apache.commons.beanutils.BeanUtils
- copyProperties ( )
- getProperty ( )
- setProperty ( )
- describe ( )
- populate ( )
- copyProperty ( )
- cloneBean ( )
* The utility classes from android are excluded since they are designed for Android apps. If you want to see more details, you can search "utils" in the search portal: http://www.programcreek.com/java-api-examples/index.php. If the name of a utility class does not contain "utils", the class is not selected.
Also org.apache.commons.lang is the old version of import org.apache.commons.lang3.
Top 15 Java Utility Classes的更多相关文章
- Top 16 Java 应用类 - 这些功能再也不用自己写了
Java中有很多应用类.这些类定义静态方法能够解决非常多常见的问题.以下是通过5万个开源项目统计得到的最热门的16个应用类. 类按热门程序排列.类的方法也是按热门程序排序. 浏览这个类能够看看有哪些功 ...
- add a private constructor to hide the implicit public one(Utility classes should not have public constructors)
sonarlint提示add a private constructor to hide the implicit public one Utility classes should not have ...
- JDK 15 JAVA 15的新特性展望
目录 JEP 371: Hidden Classes JEP 372: 删除 Nashorn JavaScript Engine JEP 377: 新的垃圾回收器ZGC正式上线了 JEP 378: T ...
- Top 20 Java Libries Used by Github's Most Popular Java Projects
Top 20 Java Libries Used by Github's Most Popular Java Projects:
- Utility Classes Are Evil
原文地址:http://alphawang.com/blog/2014/09/utility-classes-are-evil/ This post is a summary of this arti ...
- Java-Runoob-高级教程-实例-方法:15. Java 实例 – 重载(overloading)方法中使用 Varargs
ylbtech-Java-Runoob-高级教程-实例-方法:15. Java 实例 – 重载(overloading)方法中使用 Varargs 1.返回顶部 1. Java 实例 - 重载(ove ...
- ylbtech-Java-Runoob-高级教程-实例-数组:15. Java 实例 – 判断数组是否相等
ylbtech-Java-Runoob-高级教程-实例-数组:15. Java 实例 – 判断数组是否相等 1.返回顶部 1. Java 实例 - 判断数组是否相等 Java 实例 以下实例演示了如 ...
- Java Nested Classes(内部类~第一篇英文技术文档翻译)
鄙人最近尝试着翻译了自己的第一篇英文技术文档.Java Nested Classes Reference From Oracle Documentation 目录 嵌套类-Nested Classes ...
- [Tailwind] Abstract Utility Classes to BEM Components in Tailwind
When creating UIs with utility classes, a lot of repetition can occur within the HTML markup. In thi ...
随机推荐
- Linux find命令的用法实践
一.find命令简介 Linux下find命令在目录结构中搜索文件,并执行指定的操作.Linux下find命令提供了相当多的查找条件,功能很强大.由于find具有强大的功能,所以它的选项也很多,其中大 ...
- Tomcat 启动花费很长时间的解决方案
原始解决方案链接 将 $JAVA_PATH/jre/lib/security/java.security 中的 securerandom.source=file:/dev/urandom 替换为 se ...
- 编译软件基础知识(2/2) via LinuxSir
首先说下/etc/ld.so.conf: 这个文件记录了编译时使用的动态链接库的路径. 默认情况下,编译器只会使用/lib和/usr/lib这两个目录下的库文件 如果你安装了某些库,比如在安装gtk+ ...
- [WPF系列]-基础 TextBlock
AUTOMATICALLY SHOWING TOOLTIPS ON A TRIMMED TEXTBLOCK (SILVERLIGHT + WPF)
- 【原】CSS实现背景透明,文字不透明,兼容所有浏览器
11.11是公司成立的日子,16岁啦,我呢3岁半,感谢公司给了这样一个平台,让我得以学习和成长,这里祝愿公司发展越来越好~ 进入主题,每年11月11号是光棍节,产生于校园,本来只是一流传于年轻人的娱乐 ...
- 使用Ecplise git commit时出现"There are no stages files"
异常 解决方案 进入Window--Preferences--Team--Git--Committing,反选下图红圈部分: 保存后即可出线我们熟悉的提交代码界面啦:
- 洛谷P1462 通往奥格瑞玛的道路[二分答案 spfa 离散化]
题目背景 在艾泽拉斯大陆上有一位名叫歪嘴哦的神奇术士,他是部落的中坚力量 有一天他醒来后发现自己居然到了联盟的主城暴风城 在被众多联盟的士兵攻击后,他决定逃回自己的家乡奥格瑞玛 题目描述 在艾泽拉斯, ...
- AC日记——最大数 洛谷 P1198 [JSOI2008]
题目描述 现在请求你维护一个数列,要求提供以下两种操作: 1. 查询操作. 语法:Q L 功能:查询当前数列中末尾L个数中的最大的数,并输出这个数的值. 限制:L不超过当前数列的长度. 2. 插入操作 ...
- 简单服务接口访问时权限以及缓存HashMap实现
实现拦截器: package com.zqc.share.framework.interceptor; import javax.annotation.Resource; import javax.s ...
- Swift中的willSet与didSet
Swift中的willSet与didSet 周银辉 在Swift语言中用了willSet和didSet这两个特性来监视属性的除初始化之外的属性值变化 无需说太多,看看下面的代码你就能很快明白的 imp ...