Validation Utility - C00kier/CookiersLib GitHub Wiki
Provides helper methods to validate common data types used in Bukkit plugin development.
Checks if the provided lore list is non-null.
isLoreValid(List<String> loreList)
Parameters:
-
loreList
— the list of lore strings
Returns:
-
true
if the list is not null,false
otherwise
isStringValueValid(String value)
Parameters:
-
value
— the string to validate
Returns:
-
true
if the string is non-null and not empty,false
otherwise
Checks if a Double value is positive or zero.
isDoublePositiveOrZero(Double value)
Parameters:
-
value
— the number to check
Returns:
-
true
if the value is non-null and greater than or equal to 0,false
otherwise
Checks if an integer value is positive or zero.
isIntPositiveOrZero(int value)
Parameters:
-
value
— the number to check
Returns:
-
true
if the value is greater than or equal to 0,false
otherwise
Validates that the given sound is not null.
isSoundValid(Sound sound)
Parameters:
-
sound
— the sound to validate
Returns:
-
true
if the sound is not null,false
otherwise
Checks whether the number of provided arguments matches the expected quantity.
hasCorrectArgsQuantity(int quantity, String[] args)
Parameters:
-
quantity
— the expected number of arguments -
args
— the actual arguments array
Returns:
-
true
if the length of args equals quantity,false
otherwise