Package me.hsgamer.hscore.common
Class Validate
java.lang.Object
me.hsgamer.hscore.common.Validate
Methods to validate
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<byte[]>
Convert to Base64static Optional<BigDecimal>
Convert to numberConvert to URLConvert to UUIDstatic boolean
isClassLoaded
(@NotNull String className) Check if the class is loadedstatic boolean
isConstructorLoaded
(@NotNull String className, @NotNull Class<?>... params) Check if the constructor is loadedstatic boolean
isMethodLoaded
(@NotNull String className, @NotNull String methodName, @NotNull Class<?>... params) Check if the method is loadedstatic boolean
isNullOrEmpty
(@Nullable String string) Check if it's null or emptystatic boolean
isNullOrEmpty
(@Nullable Collection<?> list) Check if it's null or empty
-
Method Details
-
getNumber
Convert to number- Parameters:
input
- the string- Returns:
- the number
-
getURL
Convert to URL- Parameters:
input
- the string- Returns:
- the URL
-
getBase64
Convert to Base64- Parameters:
input
- the input- Returns:
- the Base64
-
getUUID
Convert to UUID- Parameters:
input
- the input- Returns:
- the UUID
-
isClassLoaded
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 pathmethodName
- the method's nameparams
- 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 pathparams
- the type of parameters- Returns:
- whether it's loaded
-
isNullOrEmpty
Check if it's null or empty- Parameters:
list
- the list- Returns:
- whether it's null or empty
-
isNullOrEmpty
Check if it's null or empty- Parameters:
string
- the string- Returns:
- whether it's null or empty
-