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:
-
trueif the list is not null,falseotherwise
isStringValueValid(String value)
Parameters:
-
value— the string to validate
Returns:
-
trueif the string is non-null and not empty,falseotherwise
Checks if a Double value is positive or zero.
isDoublePositiveOrZero(Double value)
Parameters:
-
value— the number to check
Returns:
-
trueif the value is non-null and greater than or equal to 0,falseotherwise
Checks if an integer value is positive or zero.
isIntPositiveOrZero(int value)
Parameters:
-
value— the number to check
Returns:
-
trueif the value is greater than or equal to 0,falseotherwise
Validates that the given sound is not null.
isSoundValid(Sound sound)
Parameters:
-
sound— the sound to validate
Returns:
-
trueif the sound is not null,falseotherwise
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:
-
trueif the length of args equals quantity,falseotherwise