Package software.bluelib.utils
Class IsValidUtils
java.lang.Object
software.bluelib.utils.IsValidUtils
A
class providing utility methods for various common operations.
Key Methods:
isValidURL(String)- Checks if a string is a valid URL.isValidEmail(String)- Checks if a string is a valid email address.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisValidColor(String pInput) Validates if a color string is in a recognized format.static booleanisValidEmail(String pEmail) ABooleanthat checks if a string is a valid email address.static booleanisValidURL(String pUrl) Apublic staticBooleanto check if a string is a valid URL.
-
Method Details
-
isValidURL
Apublic staticBooleanto check if a string is a valid URL.This method checks if a string is a well-formed URL. It supports both `http` and `https` schemes and automatically adds `https://` if the URL starts with "www.".
Example Input:
- "www.example.com" - Valid URL, will be prefixed with "https://".
- "https://modrinth.com/mod/bluelib" - Valid URL.
- "invalid-url" - Not a valid URL.
- Parameters:
pUrl-String- The URL string to validate.- Returns:
trueif the string is a valid URL,falseotherwise.- Since:
- 1.4.0
-
isValidEmail
ABooleanthat checks if a string is a valid email address.- Parameters:
pEmail-String- The string to be checked.- Returns:
trueif the string is a valid email address,falseotherwise.- Since:
- 1.0.0
-
isValidColor
Validates if a color string is in a recognized format.Purpose: This method checks if a color string matches any of the supported formats.
When: Called to validate color strings.
Where: Used in contexts where color validation is required.
Additional Info: Supports RGB, ARGB, and hexadecimal formats.- Parameters:
pInput- the color string to validate- Returns:
- true if valid, false otherwise
- Since:
- 1.6.0
-