The org.apache.commons.lang3 package is actually the version 3 of the org.apache.commons.lang package. The decision to create a new package was forced by the fact that changes introduced in version 3 were backward incompatible, which means that the existing applications that use the previous version of org.apache.commons.lang package may stop working after the upgrade to version 3. But in the majority of mainstream programming, adding 3 to an import statement (as the way to migrate to the new version) typically does not break anything.
According to the documentation, the org.apache.commons.lang3 package provides highly reusable static utility methods, chiefly concerned with adding value to the java.lang classes. Here are a few notable examples:
- ArrayUtils class: Allows to search and manipulate arrays; we discussed and demonstrated it in Chapter 6, Data Structures, Generics, and Popular Utilities
- ClassUtils class: Provides some metadata about a class
- ObjectUtils class: Checks an array of objects for null, compares objects, and calculates the median and minimum/maximum of an array of objects in a null-safe manner; we discussed and demonstrated it in Chapter 6, Data Structures, Generics, and Popular Utilities
- SystemUtils class: Provides information about the execution environment
- ThreadUtils class: Finds information about currently running threads
- Validate class: Validates individual values and collections, compares them, checks for null, matches, and performs many other validations
- RandomStringUtils class: Generates String objects from the characters of various character sets
- StringUtils class: We discussed in Chapter 5, String, Input/Output, and Files