java.lang.Object
org.litebridge.commons.ModuleUtils
Utility class for Java Module System (JPMS) related operations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Class<T> requireAccessible(Class<T> dtoClass) Ensures that the specified class is accessible to the current module.static <T> Class<T> requireAccessible(Class<T> dtoClass, Module targetModule) Ensures that the specified class is accessible to the target module.
-
Method Details
-
requireAccessible
Ensures that the specified class is accessible to the current module.- Type Parameters:
T- the type of the class- Parameters:
dtoClass- the class to check for accessibility- Returns:
- the specified class if it is accessible
- Throws:
IllegalArgumentException- if the class is not accessible
-
requireAccessible
Ensures that the specified class is accessible to the target module.- Type Parameters:
T- the type of the class- Parameters:
dtoClass- the class to check for accessibilitytargetModule- the module that needs access to the class- Returns:
- the specified class if it is accessible
- Throws:
IllegalArgumentException- if the class is not accessible
-