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 ...
随机推荐
- 【转】能否用讲个故事的方式,由浅入深,通俗易懂地解释一下什么是天使投资,VC,PE.
能否用讲个故事的方式,由浅入深,通俗易懂地解释一下什么是天使投资,VC,PE 今天在知乎上看到一篇文章,觉得值得一转的,Here. 我给楼主讲个完整点的故事吧.长文慎点,前方高能,自备避雷针.18岁以 ...
- EF with (LocalDb)V11.0
EF虽说对LocalDb支持的不错,但LocalDb有自身的缺陷(不想sqlite那样数据库文件可以像普通文件一样使用). LocalDb在一个计算机上会对数据库有唯一性约束,要求本机的localdb ...
- JS -- 异步加载进度条
今天在博客园问答里面看到博友问道怎么实现Ajax异步加载产生进度条. 很好奇就自己写了一个. 展现效果: 1) 当点击Load的时候,模拟执行异步加载. 浏览器被遮挡. 进度条出现. 实现思路: 1. ...
- plain framework 1(简约框架)一款主要用于网络(游戏)开发的C/C++框架 即将开源发布
在我们的日常开发中,我们往往会遇到这种情况,当我们换了一个开发环境时很可能会重新利用一套新的框架进行开发.由于不同框架有着不同的接口,所以我们不得不花时间再次熟悉这些接口,这将造成开发时间上的重复,而 ...
- JS入门学习,写一个简单的图片库
<!-- 新手刚开始学JS,每天坚持写点东西 坚持下去,希望能有所进步 . 加油~~ --> <!DOCTYPE html> ...
- CF733C Epidemic in Monstropolis[模拟 构造 贪心]
C. Epidemic in Monstropolis time limit per test 1 second memory limit per test 256 megabytes input s ...
- js中的按键事件
参考链接:http://blog.csdn.net/zhouziyu2011/article/details/53978293 <input type="text" id=& ...
- PAT 1036. 跟奥巴马一起编程(15)
美国总统奥巴马不仅呼吁所有人都学习编程,甚至以身作则编写代码,成为美国历史上首位编写计算机代码的总统.2014年底,为庆祝"计算机科学教育周"正式启动,奥巴马编写了很简单的计算机代 ...
- Spring源码分析——资源访问利器Resource之接口和抽象类分析
从今天开始,一步步走上源码分析的路.刚开始肯定要从简单着手.我们先从Java发展史上最强大的框架——Spring...旗下的资源抽象接口Resource开始吧. 我看了好多分析Spring源码的,每每 ...
- JS判断字符串长度的5个方法
这篇文章主要介绍了JS判断字符串长度的5个方法,并且区分中文和英文,需要的朋友可以参考下 目的:计算字符串长度(英文占1个字符,中文汉字占2个字符) 方法一: 代码如下: String.pr ...