Java org.apache.commons.lang3 ClassUtils fields, constructors, methods, implement or subclass

Example usage for Java org.apache.commons.lang3 ClassUtils fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.apache.commons.lang3 ClassUtils.

The text is from its open source code.

Subclass

org.apache.commons.lang3.ClassUtils has subclasses.
Click this link to see all its subclasses.

Field

charPACKAGE_SEPARATOR_CHAR
The package separator character: '.' == .
StringPACKAGE_SEPARATOR
The package separator String: ".".
StringINNER_CLASS_SEPARATOR
The inner class separator String: "$" .

Method

ListconvertClassesToClassNames(final List> classes)

Given a List of Class objects, this method converts them into class names.

A new List is returned.

List>convertClassNamesToClasses(final List classNames)

Given a List of class names, this method converts them into classes.

A new List is returned.

StringgetAbbreviatedName(final Class cls, int len)

Gets the abbreviated name of a Class .

StringgetAbbreviatedName(String className, int len)

Gets the abbreviated class name from a String .

The string passed in is assumed to be a class name - it is not checked.

The abbreviation algorithm will shorten the class name, usually without significant loss of meaning.

The abbreviated class name will always include the complete package hierarchy.

List>getAllInterfaces(final Class cls)

Gets a List of all interfaces implemented by the given class and its superclasses.

The order is determined by looking through each interface in turn as declared in the source file and following its hierarchy up.

List>getAllSuperclasses(final Class cls)

Gets a List of superclasses for the given class.

ClassgetClass(final String className)
Returns the (initialized) class represented by className using the current thread's context class loader.
ClassgetClass(final ClassLoader classLoader, final String className)
Returns the (initialized) class represented by className using the classLoader .
ClassgetClass(final String className, final boolean initialize)
Returns the class represented by className using the current thread's context class loader.
ClassgetClass(final ClassLoader classLoader, final String className, final boolean initialize)
Returns the class represented by className using the classLoader .
StringgetPackageCanonicalName(final Class cls)

Gets the package name from the canonical name of a Class .

StringgetPackageCanonicalName(final String canonicalName)

Gets the package name from the canonical name.

StringgetPackageName(final Class cls)

Gets the package name of a Class .

StringgetPackageName(String className)

Gets the package name from a String .

The string passed in is assumed to be a class name - it is not checked.

If the class is unpackaged, return an empty string.

MethodgetPublicMethod(final Class cls, final String methodName, final Class... parameterTypes)

Returns the desired Method much like Class.getMethod , however it ensures that the returned Method is from a public class or interface and not from an anonymous inner class.

StringgetShortCanonicalName(final Class cls)

Gets the canonical name minus the package name from a Class .

StringgetShortCanonicalName(final String canonicalName)

Gets the canonical name minus the package name from a String.

The string passed in is assumed to be a canonical name - it is not checked.

StringgetShortClassName(final Class cls)

Gets the class name minus the package name from a Class .

Consider using the Java 5 API Class#getSimpleName() instead.

StringgetShortClassName(String className)

Gets the class name minus the package name from a String.

The string passed in is assumed to be a class name - it is not checked.

Note that this method differs from Class.getSimpleName() in that this will return "Map.Entry" whilst the java.lang.Class variant will simply return "Entry" .

StringgetShortClassName(final Object object, final String valueIfNull)

Gets the class name minus the package name for an Object .

StringgetSimpleName(final Object object, final String valueIfNull)

Null-safe version of aClass.getSimpleName()

StringgetSimpleName(final Class cls)

Null-safe version of aClass.getSimpleName()

Iterable>hierarchy(final Class type, final Interfaces interfacesBehavior)
Get an Iterable that can iterate over a class hierarchy in ascending (subclass to superclass) order.
Iterable>hierarchy(final Class type)
Get an Iterable that can iterate over a class hierarchy in ascending (subclass to superclass) order, excluding interfaces.
booleanisAssignable(final Class[] classArray, final Class... toClassArray)

Checks if an array of Classes can be assigned to another array of Classes.

This method calls #isAssignable(Class,Class) isAssignable for each Class pair in the input arrays.

booleanisAssignable(final Class cls, final Class toClass)

Checks if one Class can be assigned to a variable of another Class .

Unlike the Class#isAssignableFrom(java.lang.Class) method, this method takes into account widenings of primitive classes and null s.

Primitive widenings allow an int to be assigned to a long, float or double.

booleanisAssignable(Class[] classArray, Class[] toClassArray, final boolean autoboxing)

Checks if an array of Classes can be assigned to another array of Classes.

This method calls #isAssignable(Class,Class) isAssignable for each Class pair in the input arrays.

booleanisAssignable(Class cls, final Class toClass, final boolean autoboxing)

Checks if one Class can be assigned to a variable of another Class .

Unlike the Class#isAssignableFrom(java.lang.Class) method, this method takes into account widenings of primitive classes and null s.

Primitive widenings allow an int to be assigned to a long, float or double.

booleanisInnerClass(final Class cls)

Is the specified class an inner class or static nested class.

booleanisPrimitiveOrWrapper(final Class type)
Returns whether the given type is a primitive or primitive wrapper ( Boolean , Byte , Character , Short , Integer , Long , Double , Float ).
booleanisPrimitiveWrapper(final Class type)
Returns whether the given type is a primitive wrapper ( Boolean , Byte , Character , Short , Integer , Long , Double , Float ).
Class[]primitivesToWrappers(final Class... classes)

Converts the specified array of primitive Class objects to an array of its corresponding wrapper Class objects.

ClassprimitiveToWrapper(final Class cls)

Converts the specified primitive Class object to its corresponding wrapper Class object.

NOTE: From v2.2, this method handles Void.TYPE , returning Void.TYPE .

Class[]toClass(final Object... array)

Converts an array of Object in to an array of Class objects.

Class[]wrappersToPrimitives(final Class... classes)

Converts the specified array of wrapper Class objects to an array of its corresponding primitive Class objects.

This method invokes wrapperToPrimitive() for each element of the passed in array.

ClasswrapperToPrimitive(final Class cls)

Converts the specified wrapper class to its corresponding primitive class.

This method is the counter part of primitiveToWrapper() .