Mainly for internal use within the framework.
Thanks to Alex Ruiz for contributing several enhancements to this class!
ClassUtils, CollectionUtils, StringUtils
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final Object[] | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static <A, O extends A> A[] | Returns: the new array (of the same component type; nevernull)the array to append to (can be array, O null)the object to append obj)Append the given object to the given array, returning a new array consisting of the input array contents plus the given object. |
| public static <A, O extends A> A[] | Returns: the new array (of the same component type; nevernull)the array to add to (can be array, O null)the object to append obj, int the position at which to add the object position)Add the given object to the given array at the specified position, returning a new array consisting of the input array contents plus the given object. |
| private static boolean | Returns: whether the given objects are equalfirst array to compare o1, Object second array to compare o2)Compare the given arrays with |
| public static < the concrete Enum type E extends Enum | caseInsensitiveValueOf(E[]
the array of all Enum constants in question, usually per enumValues, String Enum.values()the constant to get the enum value of constant)Case insensitive alternative to |
| public static boolean | Returns: whether the constant has been found in the given arraythe enum values to check, typically obtained via enumValues, String MyEnum.values()the constant name to find (must not be null or empty string) constant)Check whether the given array of enum constants contains a constant with the given name, ignoring case when determining a match. |
| public static boolean | Returns: whether the constant has been found in the given arraythe enum values to check, typically obtained via enumValues, String MyEnum.values()the constant name to find (must not be null or empty string) constant, boolean whether case is significant in determining a match caseSensitive)Check whether the given array of enum constants contains a constant with the given name. |
| public static boolean | Returns: whether the element has been found in the given arraythe array to check (may be array, Object null,
in which case the return value will always be false)the element to check for element)Check whether the given array contains the given element. |
| public static String | Returns: a display String representation ofobjthe object to build a display String for obj)Return a content-based String representation if |
| public static String | Returns: the object's identity code in hex notationthe object obj)Return a hex String form of an object's identity hash code. |
| public static String | Returns: the object's identity as String representation, or an empty String if the object wasnullthe object (may be obj)null)Return a String representation of an object's overall identity. |
| public static boolean | |
| public static boolean | Returns: whether the throwable is a checked exceptionthe throwable to check ex)Return whether the given throwable is a checked exception: that is, neither a RuntimeException nor an Error. |
| public static boolean | Returns: whether the given exception is compatiblethe exception to check ex, Class<?>... the exception types declared in the throws clause declaredExceptions)Check whether the given exception is compatible with the specified
exception types, as declared in a |
| public static boolean | |
| public static boolean | |
| public static String | Returns: the corresponding class namethe object to introspect (may be obj)null)Determine the class name for the given object. |
| public static String | Returns: a concise string representation of the supplied objectthe object to build a string representation for obj)Generate a null-safe, concise string representation of the supplied object as described below. |
| public static boolean | Returns: whether the given objects are equalfirst Object to compare o1, Object second Object to compare o2)Determine if the given objects are equal, returning |
| public static int | Returns: a hash value of the elementsthe elements to be hashed elements)Return a hash code for the given elements, delegating to
|
| public static int | nullSafeHashCode(Object obj)
Return a hash code for the given object; typically the value of
|
| public static int | nullSafeHashCode(Object[] array)
Deprecated
since 6.1. as of 6.1 in favor of
Return a hash code based on the contents of the specified array.
Arrays#hashCode(Object[])
|
| public static int | nullSafeHashCode(boolean[] array)
Deprecated
since 6.1. as of 6.1 in favor of
Return a hash code based on the contents of the specified array.
Arrays#hashCode(boolean[])
|
| public static int | nullSafeHashCode(byte[] array)
Deprecated
since 6.1. as of 6.1 in favor of
Return a hash code based on the contents of the specified array.
Arrays#hashCode(byte[])
|
| public static int | nullSafeHashCode(char[] array)
Deprecated
since 6.1. as of 6.1 in favor of
Return a hash code based on the contents of the specified array.
Arrays#hashCode(char[])
|
| public static int | nullSafeHashCode(double[] array)
Deprecated
since 6.1. as of 6.1 in favor of
Return a hash code based on the contents of the specified array.
Arrays#hashCode(double[])
|
| public static int | nullSafeHashCode(float[] array)
Deprecated
since 6.1. as of 6.1 in favor of
Return a hash code based on the contents of the specified array.
Arrays#hashCode(float[])
|
| public static int | nullSafeHashCode(int[] array)
Deprecated
since 6.1. as of 6.1 in favor of
Return a hash code based on the contents of the specified array.
Arrays#hashCode(int[])
|
| public static int | nullSafeHashCode(long[] array)
Deprecated
since 6.1. as of 6.1 in favor of
Return a hash code based on the contents of the specified array.
Arrays#hashCode(long[])
|
| public static int | nullSafeHashCode(short[] array)
Deprecated
since 6.1. as of 6.1 in favor of
Return a hash code based on the contents of the specified array.
Arrays#hashCode(short[])
|
| public static String | Returns: a String representation ofobjthe object to build a String representation for obj)Return a String representation of the specified Object. |
| public static String | Returns: a String representation ofarraythe array to build a String representation for array)Return a String representation of the contents of the specified array. |
| public static String | Returns: a String representation ofarraythe array to build a String representation for array)Return a String representation of the contents of the specified array. |
| public static String | Returns: a String representation ofarraythe array to build a String representation for array)Return a String representation of the contents of the specified array. |
| public static String | Returns: a String representation ofarraythe array to build a String representation for array)Return a String representation of the contents of the specified array. |
| public static String | Returns: a String representation ofarraythe array to build a String representation for array)Return a String representation of the contents of the specified array. |
| public static String | Returns: a String representation ofarraythe array to build a String representation for array)Return a String representation of the contents of the specified array. |
| public static String | Returns: a String representation ofarraythe array to build a String representation for array)Return a String representation of the contents of the specified array. |
| public static String | Returns: a String representation ofarraythe array to build a String representation for array)Return a String representation of the contents of the specified array. |
| public static String | Returns: a String representation ofarraythe array to build a String representation for array)Return a String representation of the contents of the specified array. |
| public static Object[] | Returns: the corresponding object array (nevernull)the (potentially primitive) array source)Convert the given array (which may be a primitive array) to an object array (if necessary of primitive wrapper objects). |
| public static Object | Returns: either the value held within theOptional, null
if the Optional is empty, or simply the given object as-isthe candidate object obj)Unwrap the given object which is potentially a |
| ARRAY_ELEMENT_SEPARATOR | back to summary |
|---|---|
| private static final String ARRAY_ELEMENT_SEPARATOR | |
| ARRAY_END | back to summary |
|---|---|
| private static final String ARRAY_END | |
| ARRAY_START | back to summary |
|---|---|
| private static final String ARRAY_START | |
| COLLECTION | back to summary |
|---|---|
| private static final String COLLECTION | |
| EMPTY_ARRAY | back to summary |
|---|---|
| private static final String EMPTY_ARRAY | |
| EMPTY_OBJECT_ARRAY | back to summary |
|---|---|
| private static final Object[] EMPTY_OBJECT_ARRAY | |
| EMPTY_STRING | back to summary |
|---|---|
| private static final String EMPTY_STRING | |
| MAP | back to summary |
|---|---|
| private static final String MAP | |
| NON_EMPTY_ARRAY | back to summary |
|---|---|
| private static final String NON_EMPTY_ARRAY | |
| NULL_STRING | back to summary |
|---|---|
| private static final String NULL_STRING | |
| ObjectUtils | back to summary |
|---|---|
| public ObjectUtils() | |
| addObjectToArray | back to summary |
|---|---|
| public static <A, O extends A> A[] addObjectToArray(A[] array, O obj) Append the given object to the given array, returning a new array consisting of the input array contents plus the given object.
| |
| addObjectToArray | back to summary |
|---|---|
| public static <A, O extends A> A[] addObjectToArray(A[] array, O obj, int position) Add the given object to the given array at the specified position, returning a new array consisting of the input array contents plus the given object.
| |
| arrayEquals | back to summary |
|---|---|
| private static boolean arrayEquals(Object o1, Object o2) Compare the given arrays with
| |
| caseInsensitiveValueOf | back to summary |
|---|---|
| public static <E extends Enum Case insensitive alternative to
| |
| containsConstant | back to summary |
|---|---|
| public static boolean containsConstant(Enum<?>[] enumValues, String constant) Check whether the given array of enum constants contains a constant with the given name, ignoring case when determining a match. | |
| containsConstant | back to summary |
|---|---|
| public static boolean containsConstant(Enum<?>[] enumValues, String constant, boolean caseSensitive) Check whether the given array of enum constants contains a constant with the given name.
| |
| containsElement | back to summary |
|---|---|
| public static boolean containsElement(Object[] array, Object element) Check whether the given array contains the given element. | |
| getDisplayString | back to summary |
|---|---|
| public static String getDisplayString(Object obj) Return a content-based String representation if Differs from
| |
| getIdentityHexString | back to summary |
|---|---|
| public static String getIdentityHexString(Object obj) Return a hex String form of an object's identity hash code. | |
| identityToString | back to summary |
|---|---|
| public static String identityToString(Object obj) Return a String representation of an object's overall identity. | |
| isArray | back to summary |
|---|---|
| public static boolean isArray(Object obj) Determine whether the given object is an array: either an Object array or a primitive array.
| |
| isCheckedException | back to summary |
|---|---|
| public static boolean isCheckedException(Throwable ex) Return whether the given throwable is a checked exception: that is, neither a RuntimeException nor an Error.
| |
| isCompatibleWithThrowsClause | back to summary |
|---|---|
| public static boolean isCompatibleWithThrowsClause(Throwable ex, Class<?>... declaredExceptions) Check whether the given exception is compatible with the specified
exception types, as declared in a | |
| isEmpty | back to summary |
|---|---|
| public static boolean isEmpty(Object[] array) Determine whether the given array is empty:
i.e.
| |
| isEmpty | back to summary |
|---|---|
| public static boolean isEmpty(Object obj) Determine whether the given object is empty. This method supports the following object types.
If the given object is non-null and not one of the aforementioned
supported types, this method returns
| |
| nullSafeClassName | back to summary |
|---|---|
| public static String nullSafeClassName(Object obj) Determine the class name for the given object. Returns a | |
| nullSafeConciseToString | back to summary |
|---|---|
| public static String nullSafeConciseToString(Object obj) Generate a null-safe, concise string representation of the supplied object as described below. Favor this method over Returns:
In the context of this method, a simple value type is any of the following:
primitive wrapper (excluding
| |
| nullSafeEquals | back to summary |
|---|---|
| public static boolean nullSafeEquals(Object o1, Object o2) Determine if the given objects are equal, returning Compares arrays with
| |
| nullSafeHash | back to summary |
|---|---|
| public static int nullSafeHash(Object... elements) Return a hash code for the given elements, delegating to
| |
| nullSafeHashCode | back to summary |
|---|---|
| public static int nullSafeHashCode(Object obj) Return a hash code for the given object; typically the value of
| |
| nullSafeHashCode | back to summary |
|---|---|
| public static int nullSafeHashCode(Object[] array)
Return a hash code based on the contents of the specified array.
If
| |
| nullSafeHashCode | back to summary |
|---|---|
| public static int nullSafeHashCode(boolean[] array)
Return a hash code based on the contents of the specified array.
If
| |
| nullSafeHashCode | back to summary |
|---|---|
| public static int nullSafeHashCode(byte[] array)
Return a hash code based on the contents of the specified array.
If
| |
| nullSafeHashCode | back to summary |
|---|---|
| public static int nullSafeHashCode(char[] array)
Return a hash code based on the contents of the specified array.
If
| |
| nullSafeHashCode | back to summary |
|---|---|
| public static int nullSafeHashCode(double[] array)
Return a hash code based on the contents of the specified array.
If
| |
| nullSafeHashCode | back to summary |
|---|---|
| public static int nullSafeHashCode(float[] array)
Return a hash code based on the contents of the specified array.
If
| |
| nullSafeHashCode | back to summary |
|---|---|
| public static int nullSafeHashCode(int[] array)
Return a hash code based on the contents of the specified array.
If
| |
| nullSafeHashCode | back to summary |
|---|---|
| public static int nullSafeHashCode(long[] array)
Return a hash code based on the contents of the specified array.
If
| |
| nullSafeHashCode | back to summary |
|---|---|
| public static int nullSafeHashCode(short[] array)
Return a hash code based on the contents of the specified array.
If
| |
| nullSafeToString | back to summary |
|---|---|
| public static String nullSafeToString(Object obj) Return a String representation of the specified Object. Builds a String representation of the contents in case of an array.
Returns a
| |
| nullSafeToString | back to summary |
|---|---|
| public static String nullSafeToString(Object[] array) Return a String representation of the contents of the specified array. The String representation consists of a list of the array's elements,
enclosed in curly braces ( | |
| nullSafeToString | back to summary |
|---|---|
| public static String nullSafeToString(boolean[] array) Return a String representation of the contents of the specified array. The String representation consists of a list of the array's elements,
enclosed in curly braces (
| |
| nullSafeToString | back to summary |
|---|---|
| public static String nullSafeToString(byte[] array) Return a String representation of the contents of the specified array. The String representation consists of a list of the array's elements,
enclosed in curly braces (
| |
| nullSafeToString | back to summary |
|---|---|
| public static String nullSafeToString(char[] array) Return a String representation of the contents of the specified array. The String representation consists of a list of the array's elements,
enclosed in curly braces (
| |
| nullSafeToString | back to summary |
|---|---|
| public static String nullSafeToString(double[] array) Return a String representation of the contents of the specified array. The String representation consists of a list of the array's elements,
enclosed in curly braces (
| |
| nullSafeToString | back to summary |
|---|---|
| public static String nullSafeToString(float[] array) Return a String representation of the contents of the specified array. The String representation consists of a list of the array's elements,
enclosed in curly braces (
| |
| nullSafeToString | back to summary |
|---|---|
| public static String nullSafeToString(int[] array) Return a String representation of the contents of the specified array. The String representation consists of a list of the array's elements,
enclosed in curly braces (
| |
| nullSafeToString | back to summary |
|---|---|
| public static String nullSafeToString(long[] array) Return a String representation of the contents of the specified array. The String representation consists of a list of the array's elements,
enclosed in curly braces (
| |
| nullSafeToString | back to summary |
|---|---|
| public static String nullSafeToString(short[] array) Return a String representation of the contents of the specified array. The String representation consists of a list of the array's elements,
enclosed in curly braces (
| |
| toObjectArray | back to summary |
|---|---|
| public static Object[] toObjectArray(Object source) Convert the given array (which may be a primitive array) to an object array (if necessary of primitive wrapper objects). A
| |
| unwrapOptional | back to summary |
|---|---|
| public static Object unwrapOptional(Object obj) Unwrap the given object which is potentially a | |