Class ClassUtils

java.lang.Object
xyz.dynxsty.dih4jda.util.ClassUtils

public class ClassUtils extends Object
Utility class for working with classes.
Since:
v1.4
  • Method Details

    • doesImplement

      public static boolean doesImplement(@Nonnull Class<?> base, @Nonnull Class<?> implementation)
      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