public class ValidationUtil extends Object
| Constructor and Description |
|---|
ValidationUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
hasElements(List value,
String valueName)
Checks if the specified list has elements.
|
static void |
hasText(String value,
String valueName)
Checks if the specified string has text.
|
static void |
hasTextTrimWithMaxLength(String value,
int length,
String valueName)
Checks if the specified string has text, does not exceed the specified length, and does not have leading or trailing spaces.
|
static void |
hasTextWithMaxLength(String value,
int length,
String valueName)
Checks if the specified string has text and does not exceed the specified length.
|
public static void hasText(String value, String valueName)
value - The string to check.valueName - The name of the string.IllegalArgumentException - If the string is null or white space.public static void hasTextWithMaxLength(String value, int length, String valueName)
value - The string to check.length - The maximum length.valueName - The name of the string.IllegalArgumentException - If the string is null, white space, or too long.public static void hasTextTrimWithMaxLength(String value, int length, String valueName)
value - The string to check.length - The maximum length.valueName - The name of the string.IllegalArgumentException - If the string is null, white space, too long, or has leading or trailing spaces.public static void hasElements(List value, String valueName)
value - The list to check.valueName - The name of the list.IllegalArgumentException - If the list is null or empty.Copyright © 2018–2024. All rights reserved.