Class Checks

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

public class Checks extends Object
Utility class for checking certain conditions.
Since:
v1.4
  • Method Details

    • checkImplementation

      public static boolean checkImplementation(@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
    • checkEmptyConstructor

      public static boolean checkEmptyConstructor(@Nonnull Class<?> base)
      Checks if the given class has an empty constructor.
      Parameters:
      base - The class to check.
      Returns:
      Whether the class has an empty constructor.
      Since:
      v1.5.1
    • notNull

      public static void notNull(@Nullable Object argument, @Nonnull String name)
      Throws an IllegalArgumentException if the given Object is null.
      Parameters:
      argument - The Object to check.
      name - The name of the Object.
      Throws:
      IllegalArgumentException - if the given argument is null.