Package com.amazonaws.util
Class ValidationUtils
- java.lang.Object
-
- com.amazonaws.util.ValidationUtils
-
public class ValidationUtils extends Object
Useful utilities to validate dependencies
-
-
Constructor Summary
Constructors Constructor Description ValidationUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
assertAllAreNull(String messageIfNull, Object... objects)
Asserts that all of the objects are null.static <T> T
assertNotNull(T object, String fieldName)
Asserts that the given object is non-null and returns it.
-
-
-
Method Detail
-
assertNotNull
public static <T> T assertNotNull(T object, String fieldName) throws IllegalArgumentException
Asserts that the given object is non-null and returns it.- Parameters:
object
- Object to assert onfieldName
- Field name to display in exception message if null- Returns:
- Object if non null
- Throws:
IllegalArgumentException
- If object was null
-
assertAllAreNull
public static void assertAllAreNull(String messageIfNull, Object... objects) throws IllegalArgumentException
Asserts that all of the objects are null.- Throws:
IllegalArgumentException
- if any object provided was NOT null.
-
-