Package com.hotels.beans.utils
Class ValidationUtils
- java.lang.Object
-
- com.hotels.beans.utils.ValidationUtils
-
public class ValidationUtils extends Object
Validation utils for Class objects.
-
-
Constructor Summary
Constructors Constructor Description ValidationUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> void
notNull(T object)
Validate that the specified argument is notnull
; otherwise throws anIllegalArgumentException
with the specified message.static <T> void
notNull(T object, String message)
Validate that the specified argument is notnull
; otherwise throws anIllegalArgumentException
with the specified message.
-
-
-
Method Detail
-
notNull
public static <T> void notNull(T object)
Validate that the specified argument is notnull
; otherwise throws anIllegalArgumentException
with the specified message.- Type Parameters:
T
- the object type- Parameters:
object
- the object to check- Throws:
IllegalArgumentException
- if the object isnull
-
notNull
public static <T> void notNull(T object, String message)
Validate that the specified argument is notnull
; otherwise throws anIllegalArgumentException
with the specified message.- Type Parameters:
T
- the object type- Parameters:
object
- the object to checkmessage
- theString.format(String, Object...)
exception message if invalid, not null- Throws:
IllegalArgumentException
- if the object isnull
-
-