Class Contracts
- java.lang.Object
-
- org.hibernate.validator.internal.util.Contracts
-
public final class Contracts extends Object
- Author:
- Gunnar Morling, Hardy Ferentschik, Kevin Pollet <kevin.pollet@serli.com> (C) 2012 SERLI
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidassertNotEmpty(boolean[] array, String message)static voidassertNotEmpty(byte[] array, String message)static voidassertNotEmpty(char[] array, String message)static voidassertNotEmpty(double[] array, String message)static voidassertNotEmpty(float[] array, String message)static voidassertNotEmpty(int[] array, String message)static voidassertNotEmpty(long[] array, String message)static voidassertNotEmpty(short[] array, String message)static voidassertNotEmpty(Object[] array, String message)static voidassertNotEmpty(String s, String message)static voidassertNotEmpty(Collection<?> collection, String message)static voidassertNotEmpty(Collection<?> collection, String message, Object... messageParameters)static voidassertNotNull(Object o)static voidassertNotNull(Object o, String message)Asserts that the given object is notnull.static voidassertTrue(boolean condition, String message)static voidassertTrue(boolean condition, String message, Object... messageParameters)static voidassertValueNotNull(Object o, String name)Asserts that the given object is notnull.
-
-
-
Method Detail
-
assertNotNull
public static void assertNotNull(Object o)
-
assertNotNull
public static void assertNotNull(Object o, String message)
Asserts that the given object is notnull.- Parameters:
o- The object to check.message- A message text which will be used as message of the resulting exception if the given object isnull.- Throws:
IllegalArgumentException- In case the given object isnull.
-
assertValueNotNull
public static void assertValueNotNull(Object o, String name)
Asserts that the given object is notnull.- Parameters:
o- The object to check.name- The name of the value to check. A message of the form "<name> must not be null" will be used as message of the resulting exception if the given object isnull.- Throws:
IllegalArgumentException- In case the given object isnull.
-
assertTrue
public static void assertTrue(boolean condition, String message)
-
assertTrue
public static void assertTrue(boolean condition, String message, Object... messageParameters)
-
assertNotEmpty
public static void assertNotEmpty(Collection<?> collection, String message)
-
assertNotEmpty
public static void assertNotEmpty(Collection<?> collection, String message, Object... messageParameters)
-
assertNotEmpty
public static void assertNotEmpty(byte[] array, String message)
-
assertNotEmpty
public static void assertNotEmpty(short[] array, String message)
-
assertNotEmpty
public static void assertNotEmpty(int[] array, String message)
-
assertNotEmpty
public static void assertNotEmpty(long[] array, String message)
-
assertNotEmpty
public static void assertNotEmpty(float[] array, String message)
-
assertNotEmpty
public static void assertNotEmpty(double[] array, String message)
-
assertNotEmpty
public static void assertNotEmpty(boolean[] array, String message)
-
assertNotEmpty
public static void assertNotEmpty(char[] array, String message)
-
-