@API(status=MAINTAINED,
since="1.1")
public final class ClassSupport
extends java.lang.Object
ClassSupport provides static utility methods for common tasks
regarding classes — for example, generating a
comma-separated list of fully qualified class names for a set of supplied
classes.
TestEngine and extension
authors are encouraged to use these supported methods in order to align with
the behavior of the JUnit Platform.
AnnotationSupport,
ModifierSupport,
ReflectionSupport| Modifier | Constructor and Description |
|---|---|
private |
ClassSupport() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
nullSafeToString(java.lang.Class<?>... classes)
Generate a comma-separated list of fully qualified class names for the
supplied classes.
|
static java.lang.String |
nullSafeToString(java.util.function.Function<? super java.lang.Class<?>,? extends java.lang.String> mapper,
java.lang.Class<?>... classes)
Generate a comma-separated list of mapped values for the supplied classes.
|
public static java.lang.String nullSafeToString(java.lang.Class<?>... classes)
classes - the classes whose names should be included in the
generated stringnull or emptynullSafeToString(Function, Class...)public static java.lang.String nullSafeToString(java.util.function.Function<? super java.lang.Class<?>,? extends java.lang.String> mapper,
java.lang.Class<?>... classes)
The values are generated by the supplied mapper
(e.g., Class::getName, Class::getSimpleName, etc.), unless
a class reference is null in which case it will be mapped to
"null".
mapper - the mapper to use; never nullclasses - the classes to mapnull or emptynullSafeToString(Class...)