@Deprecated public class ValidationUtils extends Object
| Constructor | Description |
|---|---|
ValidationUtils() |
Deprecated.
|
| Modifier and Type | Method | Description |
|---|---|---|
static void |
assertAllAreNull(String messageIfNull,
Object... objects) |
Deprecated.
Asserts that all of the objects are null.
|
static int |
assertIsPositive(int num,
String fieldName) |
Deprecated.
Asserts that the given number is positive (non-negative and non-zero).
|
static Duration |
assertIsPositive(Duration duration,
String fieldName) |
Deprecated.
Asserts that the given duration is positive (non-negative and non-zero).
|
static <T> T[] |
assertNotEmpty(T[] array,
String fieldName) |
Deprecated.
|
static <T extends Collection<?>> |
assertNotEmpty(T collection,
String fieldName) |
Deprecated.
|
static <T> T |
assertNotNull(T object,
String fieldName) |
Deprecated.
Asserts that the given object is non-null and returns it.
|
static String |
assertStringNotEmpty(String string,
String fieldName) |
Deprecated.
|
public static <T> T assertNotNull(T object,
String fieldName)
throws IllegalArgumentException
object - Object to assert onfieldName - Field name to display in exception message if nullIllegalArgumentException - If object was nullpublic static void assertAllAreNull(String messageIfNull, Object... objects) throws IllegalArgumentException
IllegalArgumentException - if any object provided was NOT null.public static int assertIsPositive(int num,
String fieldName)
num - Number to validatefieldName - Field name to display in exception message if not positive.public static Duration assertIsPositive(Duration duration, String fieldName)
duration - Number to validatefieldName - Field name to display in exception message if not positive.public static <T extends Collection<?>> T assertNotEmpty(T collection, String fieldName) throws IllegalArgumentException
IllegalArgumentExceptionpublic static <T> T[] assertNotEmpty(T[] array,
String fieldName)
throws IllegalArgumentException
IllegalArgumentExceptionpublic static String assertStringNotEmpty(String string, String fieldName) throws IllegalArgumentException
IllegalArgumentExceptionCopyright © 2017 Amazon Web Services, Inc. All Rights Reserved.