public abstract class StringArgs
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.util.regex.Pattern |
WHITESPACES_ONLY
A pattern for matching only whitespaces
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
requireMatches(java.lang.String value,
java.util.regex.Pattern pattern,
java.lang.String message)
Require that the given value matches the given pattern
|
static java.lang.String |
requireNonBlank(java.lang.String value,
java.lang.String message)
Require that the given value is non-blank (not whitespaces only)
|
static java.lang.String |
requireNonEmpty(java.lang.String value,
java.lang.String message)
Require that the given value is not empty
|
public static final java.util.regex.Pattern WHITESPACES_ONLY
@Nonnull
public static java.lang.String requireNonBlank(java.lang.String value,
@Nonnull
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirement@Nonnull
public static java.lang.String requireNonEmpty(java.lang.String value,
@Nonnull
java.lang.String message)
value - the value to checkmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirement@Nonnull
public static java.lang.String requireMatches(java.lang.String value,
@Nonnull
java.util.regex.Pattern pattern,
@Nonnull
java.lang.String message)
value - the value to checkpattern - the pattern to matchmessage - the error message to usejava.lang.IllegalArgumentException - if the value does not satisfy the requirement