public final class Assert
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static Assert |
getInstance()
Gets the unique instance.
|
Assert |
greaterOrEqual(java.lang.Integer number,
int minValue,
java.lang.String name)
Assert that an integer is not null and is greater than or equal to minValue.
|
Assert |
isEqual(java.lang.Integer number,
int value,
java.lang.String name)
Assert that an integer is equal to value.
|
Assert |
isInRange(java.lang.Integer number,
int minValue,
int maxValue,
java.lang.String name)
Assert that an integer is not null and is in the range minValue, maxValue.
|
Assert |
isTrue(java.lang.Boolean condition,
java.lang.String name)
Assert that a condition is true.
|
Assert |
notEmpty(byte[] obj,
java.lang.String name)
Assert that a byte array is not null and not empty.
|
Assert |
notEmpty(java.util.List<? extends java.lang.Object> obj,
java.lang.String name)
Assert that a list of objects is not null and not empty.
|
Assert |
notEmpty(java.lang.String obj,
java.lang.String name)
Assert that the input string is not null and not empty.
|
Assert |
notNull(java.lang.Object obj,
java.lang.String name)
Assert that the input object is not null.
|
public static Assert getInstance()
public Assert notNull(java.lang.Object obj, java.lang.String name)
obj - the object to checkname - the object namejava.lang.IllegalArgumentException - if object is nullpublic Assert notEmpty(java.lang.String obj, java.lang.String name)
obj - the object to checkname - the object namejava.lang.IllegalArgumentException - if object is null or emptypublic Assert notEmpty(java.util.List<? extends java.lang.Object> obj, java.lang.String name)
obj - the object to checkname - the object namejava.lang.IllegalArgumentException - if object is null or emptypublic Assert notEmpty(byte[] obj, java.lang.String name)
obj - the object to checkname - the object namejava.lang.IllegalArgumentException - if object is null or emptypublic Assert isTrue(java.lang.Boolean condition, java.lang.String name)
condition - the condition to checkname - the object namejava.lang.IllegalArgumentException - if condition is null or falsepublic Assert greaterOrEqual(java.lang.Integer number, int minValue, java.lang.String name)
number - the number to checkminValue - the min accepted valuename - the object namejava.lang.IllegalArgumentException - if number is null or has a value less than minValue.public Assert isEqual(java.lang.Integer number, int value, java.lang.String name)
number - the number to checkvalue - the expected valuename - the object namejava.lang.IllegalArgumentException - if number is null or has a value less than minValue.public Assert isInRange(java.lang.Integer number, int minValue, int maxValue, java.lang.String name)
number - the number to checkminValue - the min accepted valuemaxValue - the max accepted valuename - the object namejava.lang.IllegalArgumentException - if number is null or is out of range.