Class ParameterUtils
java.lang.Object
dev.sympho.modular_commands.utils.ParameterUtils
Utility functions for Parameter interfaces.
- Since:
- 1.0
- Version:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidValidates a parameter.static voidvalidateDescription(@MatchesRegex("(?Us)^.{1,100}+$") String description) Validates the description of a parameter.static voidvalidateName(@MatchesRegex("(?U)^[-_\\p{L}\\p{N}\\p{sc=Deva}\\p{sc=Thai}]{1,32}+$") String name) Validates the name of a parameter.
-
Method Details
-
validateName
@SideEffectFree public static void validateName(@MatchesRegex("(?U)^[-_\\p{L}\\p{N}\\p{sc=Deva}\\p{sc=Thai}]{1,32}+$") String name) throws IllegalArgumentException, NullPointerException Validates the name of a parameter.- Parameters:
name- The name to validate.- Throws:
IllegalArgumentException- if the name is not valid.NullPointerException- if anullvalue was found where not allowed.
-
validateDescription
@SideEffectFree public static void validateDescription(@MatchesRegex("(?Us)^.{1,100}+$") String description) throws IllegalArgumentException, NullPointerException Validates the description of a parameter.- Parameters:
description- The description to validate.- Throws:
IllegalArgumentException- if the description is not valid.NullPointerException- if anullvalue was found where not allowed.
-
validate
@SideEffectFree public static void validate(Parameter<?> parameter) throws IllegalArgumentException, NullPointerException Validates a parameter.- Parameters:
parameter- The parameter to validate.- Throws:
IllegalArgumentException- if the parameter is not valid.NullPointerException- if anullvalue was found where not allowed.
-