java.lang.Object
org.junit.platform.commons.util.ClassLoaderUtils
Collection of utilities for working with ClassLoader and associated tasks.
DISCLAIMER
These utilities are intended solely for usage within the JUnit framework itself. Any usage by external parties is not supported. Use at your own risk!
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic ClassLoader
getClassLoader
(Class<?> clazz) Get theClassLoader
for the suppliedClass
, falling back to thedefault class loader
if the class loader for the supplied class isnull
.static ClassLoader
getLocation
(Object object) Get the location from which the supplied object's class was loaded.
-
Method Details
-
getClassLoader
Get theClassLoader
for the suppliedClass
, falling back to thedefault class loader
if the class loader for the supplied class isnull
.- Parameters:
clazz
- the class for which to retrieve the class loader; nevernull
- Since:
- 1.10
-
getDefaultClassLoader
-
getLocation
Get the location from which the supplied object's class was loaded.- Parameters:
object
- the object for whose class the location should be retrieved- Returns:
- an
Optional
containing the URL of the class' location; nevernull
but potentially empty
-