Modifier and Type | Field and Description |
---|---|
static String |
NULL_MSG_PREFIX
Null pointer error message prefix.
|
Constructor and Description |
---|
GridArgumentCheck() |
Modifier and Type | Method and Description |
---|---|
static void |
ensure(boolean cond,
String desc)
Checks if given argument's condition is equal to
true , otherwise
throws IllegalArgumentException exception. |
static void |
notEmpty(Collection<?> c,
String name)
Checks that given collection is not empty.
|
static void |
notEmpty(int[] arr,
String name)
Checks that given array is not empty.
|
static void |
notEmpty(Object[] arr,
String name)
Checks that given array is not empty.
|
static void |
notNull(Object val,
String name)
Checks if given argument value is not
null . |
static void |
notNull(Object val1,
String name1,
Object val2,
String name2)
Checks that none of the given values are
null . |
static void |
notNull(Object val1,
String name1,
Object val2,
String name2,
Object val3,
String name3)
Checks that none of the given values are
null . |
static void |
notNull(Object val1,
String name1,
Object val2,
String name2,
Object val3,
String name3,
Object val4,
String name4)
Checks that none of the given values are
null . |
static void |
notNullOrEmpty(String value,
String name)
Checks that a String is not null or empty.
|
public static final String NULL_MSG_PREFIX
public static void notNull(@Nullable Object val, String name)
null
. Otherwise - throws NullPointerException
.val
- Argument value to check.name
- Name of the argument in the code (used in error message).public static void notNull(Object val1, String name1, Object val2, String name2)
null
. Otherwise - throws NullPointerException
.val1
- 1st argument value to check.name1
- Name of the 1st argument in the code (used in error message).val2
- 2nd argument value to check.name2
- Name of the 2nd argument in the code (used in error message).public static void notNull(Object val1, String name1, Object val2, String name2, Object val3, String name3)
null
. Otherwise - throws NullPointerException
.val1
- 1st argument value to check.name1
- Name of the 1st argument in the code (used in error message).val2
- 2nd argument value to check.name2
- Name of the 2nd argument in the code (used in error message).val3
- 3rd argument value to check.name3
- Name of the 3rd argument in the code (used in error message).public static void notNull(Object val1, String name1, Object val2, String name2, Object val3, String name3, Object val4, String name4)
null
. Otherwise - throws NullPointerException
.val1
- 1st argument value to check.name1
- Name of the 1st argument in the code (used in error message).val2
- 2nd argument value to check.name2
- Name of the 2nd argument in the code (used in error message).val3
- 3rd argument value to check.name3
- Name of the 3rd argument in the code (used in error message).val4
- 4th argument value to check.name4
- Name of the 4th argument in the code (used in error message).public static void ensure(boolean cond, String desc)
true
, otherwise
throws IllegalArgumentException
exception.cond
- Argument's value condition to check.desc
- Description of the condition to be used in error message.public static void notEmpty(Collection<?> c, String name)
c
- Collection.name
- Argument name.public static void notEmpty(Object[] arr, String name)
arr
- Array.name
- Argument name.public static void notEmpty(int[] arr, String name)
arr
- Array.name
- Argument name.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017