Top Java Utility Classes

Source: Internet
Author: User
Tags addall

In Java, a utility class was 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 is ordered by popularity. The data is based in randomly selected 50,000 open source Java projects from GitHub.

Hopefully, you can get a basic idea of what is already provided and popular by browsing the list so it you know you don ' t need to program it by yourself. The names of the methods normally indicate their functions. Also click on the methods to see how they is 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

    • ToString ()
    • Consume ()
    • Tobytearray ()
    • Consumequietly ()
    • Getcontentcharset ()

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 ()

Ten. Org.apache.http.client.utils.URLEncodedUtils

    • Format ()
    • Parse ()

Org.apache.commons.codec.digest.DigestUtils.

    • Md5hex ()
    • Shahex ()
    • Sha256hex ()
    • Sha1hex ()
    • SHA ()
    • MD5 ()
    • Sha512hex ()
    • SHA1 ()

Org.apache.commons.collections.CollectionUtils.

    • IsEmpty ()
    • Isnotempty ()
    • Select ()
    • Transform ()
    • Filter ()
    • Find ()
    • Collect ()
    • Foralldo ()
    • AddAll ()
    • Isequalcollection ()

Org.apache.commons.lang3.ArrayUtils.

    • Contains ()
    • IsEmpty ()
    • Isnotempty ()
    • Add ()
    • Clone ()
    • AddAll ()
    • Subarray ()
    • IndexOf ()
    • Empty_object_array
    • Empty_string_array

Org.apache.commons.beanutils.PropertyUtils.

    • GetProperty ()
    • SetProperty ()
    • Getpropertydescriptors ()
    • IsReadable ()
    • Copyproperties ()
    • Getpropertydescriptor ()
    • Getsimpleproperty ()
    • IsWriteable ()
    • Setsimpleproperty ()
    • Getpropertytype ()

Org.apache.commons.lang3.StringEscapeUtils.

    • UNESCAPEHTML4 ()
    • ESCAPEHTML4 ()
    • EscapeXML ()
    • Unescapexml ()
    • Escapejava ()
    • Escapeecmascript ()
    • Unescapejava ()
    • Escapejson ()
    • ESCAPEXML10 ()

Org.apache.commons.beanutils.BeanUtils.

    • Copyproperties ()
    • GetProperty ()
    • SetProperty ()
    • Describe ()
    • Populate ()
    • Copyproperty ()
    • Clonebean ()

* The utility classes from Android is excluded since they is designed for Android apps. If you want to see more details, you can search for "utils" in the search Portal:http://www.programcreek.com/java-api-example s/index.php. If the name of a utility class does not contain "Utils", the class was not selected.

Also Org.apache.commons.lang is the old version of import Org.apache.commons.lang3.

Top Java Utility Classes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.