Validation Utility - C00kier/CookiersLib GitHub Wiki

Provides helper methods to validate common data types used in Bukkit plugin development.


Check if lore is valid

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

Check if String is valid

isStringValueValid(String value)

Parameters:

  • value — the string to validate

Returns:

  • true if the string is non-null and not empty, false otherwise

Check if double is positive or 0

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

Check if integer is positive or 0

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

Check if sound is valid

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

Check if has correct args quantity

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
⚠️ **GitHub.com Fallback** ⚠️