public final class InputValidator
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
isTrue(boolean condition,
MessageFormatter message)
Make sure a condition is met.
|
static java.lang.String[] |
matches(java.lang.String input,
java.util.regex.Pattern pattern,
MessageFormatter message)
Make sure input matches a given
Pattern. |
static java.lang.String |
notEmpty(java.lang.String input,
MessageFormatter message)
Make sure input is not an empty
String. |
static <T> T |
notNull(T input,
MessageFormatter message)
Make sure input is not
null. |
public static void isTrue(boolean condition,
MessageFormatter message)
throws ValidationException
condition - The condition to check.message - The exception message to use if the condition is false.ValidationException - if the condition is false.public static <T> T notNull(@Nullable T input, MessageFormatter message) throws ValidationException
null.T - The object type to check.input - The input to validate.message - The exception message to use if the input is invalid.Path object.ValidationException - if the input is invalid.public static java.lang.String notEmpty(@Nullable java.lang.String input, MessageFormatter message) throws ValidationException
String.input - The input to validate.message - The exception message to use if the input is invalid.Path object.ValidationException - if the input is invalid.public static java.lang.String[] matches(java.lang.String input,
java.util.regex.Pattern pattern,
MessageFormatter message)
throws ValidationException
Pattern.input - The input to invalidated.pattern - The pattern to check the input against.message - The exception message to use if the input is invalid.ValidationException - if the input is invalid.