Class Validate

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

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

    • getNumber

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

      public static Optional<URL> getURL(@NotNull @NotNull String input)
      Convert to URL
      Parameters:
      input - the string
      Returns:
      the URL
    • getBase64

      public static Optional<byte[]> getBase64(@NotNull @NotNull String input)
      Convert to Base64
      Parameters:
      input - the input
      Returns:
      the Base64
    • getUUID

      public static Optional<UUID> getUUID(@NotNull @NotNull String input)
      Convert to UUID
      Parameters:
      input - the input
      Returns:
      the UUID
    • 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