Package xyz.dynxsty.dih4jda.util
Class ClassUtils
java.lang.Object
xyz.dynxsty.dih4jda.util.ClassUtils
Utility class for working with classes.
- Since:
- v1.4
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
doesImplement
(Class<?> base, Class<?> implementation) Checks if the given base class implements a certain class.static Object
getInstance
(Class<?> clazz) Creates a new Instance of the given class.
-
Method Details
-
doesImplement
Checks if the given base class implements a certain class.- Parameters:
base
- The base class.implementation
- The implementation that should be checked.- Returns:
- Whether the base class is implementing the given class.
- Since:
- v1.4
-
getInstance
@Nullable public static Object getInstance(@Nonnull Class<?> clazz) throws ReflectiveOperationException Creates a new Instance of the given class.- Parameters:
clazz
- The slash command's class.- Returns:
- The Instance as a generic Object.
- Throws:
ReflectiveOperationException
- If an error occurs.- Since:
- v1.5.3
-