Class Validate

java.lang.Object
me.hsgamer.hscore.common.Validate

public final class Validate extends Object
Methods to validate
  • Method Details

    • getNumber

      @NotNull public static @NotNull Optional<BigDecimal> getNumber(@NotNull @NotNull String input)
      Convert to number
      Parameters:
      input - the string
      Returns:
      the number
    • isValidPositiveNumber

      public static boolean isValidPositiveNumber(@NotNull @NotNull String input)
      Check if it's a positive number
      Parameters:
      input - the string
      Returns:
      whether it's positive
    • isValidInteger

      public static boolean isValidInteger(@NotNull @NotNull String input)
      Check if the string is a valid number
      Parameters:
      input - the string
      Returns:
      whether it's valid
    • isClassLoaded

      public static boolean isClassLoaded(@NotNull @NotNull String className)
      Check if the class is loaded
      Parameters:
      className - the class path
      Returns:
      whether it's loaded
    • isMethodLoaded

      public static boolean isMethodLoaded(@NotNull @NotNull String className, @NotNull @NotNull String methodName, @NotNull @NotNull Class<?>... params)
      Check if the method is loaded
      Parameters:
      className - the class path
      methodName - the method's name
      params - the type of parameters
      Returns:
      whether it's loaded
    • isConstructorLoaded

      public static boolean isConstructorLoaded(@NotNull @NotNull String className, @NotNull @NotNull Class<?>... params)
      Check if the constructor is loaded
      Parameters:
      className - the class path
      params - the type of parameters
      Returns:
      whether it's loaded
    • isNullOrEmpty

      public static boolean isNullOrEmpty(@Nullable @Nullable Collection<?> list)
      Check if it's null or empty
      Parameters:
      list - the list
      Returns:
      whether it's null or empty
    • isNullOrEmpty

      public static boolean isNullOrEmpty(@Nullable @Nullable String string)
      Check if it's null or empty
      Parameters:
      string - the string
      Returns:
      whether it's null or empty
    • isValidURL

      public static boolean isValidURL(String string)
      Check if the string is a valid URL
      Parameters:
      string - the input string
      Returns:
      true if it is
    • isValidUUID

      public static boolean isValidUUID(String string)
      Check if the string is a valid UUID
      Parameters:
      string - the input string
      Returns:
      true if it is
    • isValidBase64

      public static boolean isValidBase64(String string)
      Check if the string is a valid Base64 string
      Parameters:
      string - the input string
      Returns:
      true if it is