public class ValidationUtils extends Object
| Constructor and Description |
|---|
ValidationUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkArgument(boolean expression)
Ensures the truth of an expression.
|
static void |
checkArgument(boolean expression,
String errorMessage)
Ensures the truth of an expression, throwing the custom errorMessage otherwise.
|
static void |
checkArgument(boolean expression,
Supplier<String> errorMessageSupplier)
Ensures the truth of an expression, throwing the custom errorMessage otherwise.
|
static void |
checkState(boolean expression)
Ensures the truth of an expression involving the state of the calling instance, but not
involving any parameters to the calling method.
|
static void |
checkState(boolean expression,
String errorMessage)
Ensures the truth of an expression involving the state of the calling instance, but not
involving any parameters to the calling method.
|
public static void checkArgument(boolean expression)
public static void checkArgument(boolean expression,
String errorMessage)
public static void checkArgument(boolean expression,
Supplier<String> errorMessageSupplier)
public static void checkState(boolean expression)
expression - a boolean expressionIllegalStateException - if expression is falsepublic static void checkState(boolean expression,
String errorMessage)
expression - a boolean expressionerrorMessage - - error messageIllegalStateException - if expression is falseCopyright © 2024 The Apache Software Foundation. All rights reserved.