public final class Classes extends Object
Classes.| Modifier and Type | Method and Description |
|---|---|
static Set<Class<?>> |
getCommonSuperTypes(Class<?>... classes)
Returns the
Set of common super types of the given classes,
that is, all the classes in which any instance of the given classes
can be cast into. |
static Set<Class<?>> |
getCommonSuperTypes(Iterable<Class<?>> classes)
Returns the
Set of common super types of the given classes,
that is, all the classes in which any instance of the given classes
can be cast into. |
static String |
getPackageName(Class<?> c)
Returns the name of the package of the given class or the empty
String if the class is defined in the default package. |
static String |
getQualifiedName(Class<?> c)
Returns the qualified name of the given class (package name followed
by a dot, followed by the class name).
|
static String |
getShortName(Class<?> c)
Returns only the name of the given class, that is, without its
package name and without its eventual "outer" class name.
|
static Set<Class<?>> |
getSuperTypes(Class<?> c)
Returns all the super types of the given class, that is, all the
classes in which any instance of the given class can be cast into.
|
public static String getQualifiedName(Class<?> c)
c - the class.NullPointerException - if c is null.public static String getShortName(Class<?> c)
c - the class.NullPointerException - if c is null.public static String getPackageName(Class<?> c)
String if the class is defined in the default package.c - the class.NullPointerException - if c is null.public static Set<Class<?>> getSuperTypes(Class<?> c)
c - the class.NullPointerException - if c is null.public static Set<Class<?>> getCommonSuperTypes(Class<?>... classes)
Set of common super types of the given classes,
that is, all the classes in which any instance of the given classes
can be cast into.classes - the classes.NullPointerException - if classes is null, or
if it contains a null reference.IllegalArgumentException - if classes is empty.public static Set<Class<?>> getCommonSuperTypes(Iterable<Class<?>> classes)
Set of common super types of the given classes,
that is, all the classes in which any instance of the given classes
can be cast into.classes - the classes.NullPointerException - if classes is null, or
if it contains a null reference.IllegalArgumentException - if classes is empty.Copyright © 2012–2015. All rights reserved.