public class Assert
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
areEqual(long leftValue,
long rightValue,
java.lang.String message)
Asserts that two specified values are equal.
|
static void |
areEqual(java.lang.Object leftObject,
java.lang.Object rightObject,
java.lang.String msg)
Asserts that two specified objects are equal.
|
static void |
greater(long value,
long bound,
java.lang.String message)
Asserts that the specified value is greater than the lower bound.
|
static void |
greaterOrEqual(long value,
long bound,
java.lang.String message)
Asserts that the specified value is greater or equal than the lower bound.
|
static void |
inRangeExclusive(long value,
long lowerBound,
long upperBound,
java.lang.String message)
Asserts that the specified value is in range exclusive.
|
static void |
inRangeInclusive(long value,
long lowerBound,
long upperBound,
java.lang.String message)
Asserts that the specified value is in range inclusive.
|
static void |
isContained(java.lang.Object value,
java.lang.Object[] array,
java.lang.String message) |
static void |
isFalse(boolean condition,
java.lang.String message)
Asserts that the specified condition is false.
|
static void |
isTrue(boolean condition,
java.lang.String message)
Asserts that the specified condition is truth.
|
static void |
isValidArray(byte[] array,
int offset,
int len)
Asserts that the specified array parameters are valid.
|
static void |
isValidPort(int port) |
static void |
isValidState(boolean condition,
java.lang.String message)
Checks if state condition is true.
|
static void |
isValidString(java.lang.String str)
Asserts that the specified string are valid.
|
static void |
less(long value,
long bound,
java.lang.String message)
Asserts that the specified value is less that the upper bound.
|
static void |
lessOrEqual(long value,
long bound,
java.lang.String message)
Asserts that the specified value is less or equal that the upper bound.
|
static void |
notNull(java.lang.Object reference)
Asserts that the specified reference is not
null. |
static void |
notNull(java.lang.Object reference,
java.lang.String message)
Asserts that the specified reference is not
null. |
public static void notNull(java.lang.Object reference,
java.lang.String message)
null.reference - the reference to checkmessage - the error messagejava.lang.NullPointerException - if the specified reference is nullpublic static void notNull(java.lang.Object reference)
null.reference - the reference to checkjava.lang.NullPointerException - if the specified reference is nullpublic static void isTrue(boolean condition,
java.lang.String message)
condition - the condition to checkmessage - the error messagejava.lang.IllegalArgumentException - if the specified condition is falsepublic static void isFalse(boolean condition,
java.lang.String message)
condition - the condition to checkmessage - the error messagejava.lang.IllegalArgumentException - if the specified condition is truthpublic static void greater(long value,
long bound,
java.lang.String message)
value - the value to checkbound - the value lower boundmessage - the error messagejava.lang.IllegalArgumentException - if the specified value is not greater
than the lower boundpublic static void greaterOrEqual(long value,
long bound,
java.lang.String message)
value - the value to checkbound - the value lower boundmessage - the error messagejava.lang.IllegalArgumentException - if the specified value is less
than the lower boundpublic static void less(long value,
long bound,
java.lang.String message)
value - the value to checkbound - the value upper boundmessage - the error messagejava.lang.IllegalArgumentException - if the specified value is not less
than the upper boundpublic static void lessOrEqual(long value,
long bound,
java.lang.String message)
value - the value to checkbound - the value upper boundmessage - the error messagejava.lang.IllegalArgumentException - if the specified value is not greater
than the upper boundpublic static void inRangeInclusive(long value,
long lowerBound,
long upperBound,
java.lang.String message)
value - the value to checklowerBound - the value lower boundupperBound - the value upper boundmessage - the error messagejava.lang.IllegalArgumentException - if the specified value is not in
range inclusivepublic static void inRangeExclusive(long value,
long lowerBound,
long upperBound,
java.lang.String message)
value - the value to checklowerBound - the value lower boundupperBound - the value upper boundmessage - the error messagejava.lang.IllegalArgumentException - if the specified value is not in
range exclusivepublic static void areEqual(long leftValue,
long rightValue,
java.lang.String message)
leftValue - the first valuerightValue - the second valuemessage - the error messagejava.lang.IllegalArgumentException - if the specified values are not equalpublic static void areEqual(java.lang.Object leftObject,
java.lang.Object rightObject,
java.lang.String msg)
leftObject - the first objectrightObject - the second objectmsg - the error messagejava.lang.IllegalArgumentException - if the specified objects are not equaljava.lang.NullPointerException - if some of the objects are nullpublic static void isValidArray(byte[] array,
int offset,
int len)
array - the array to checkoffset - the array offsetlen - the data lengthjava.lang.IllegalArgumentException - if the offset or length parameters are invalidjava.lang.NullPointerException - if the array reference is nullpublic static void isValidString(java.lang.String str)
str - string to checkjava.lang.IllegalArgumentException - if the string is emptyjava.lang.NullPointerException - if the string reference is nullpublic static void isValidState(boolean condition,
java.lang.String message)
condition - state condition to checkmessage - error messagejava.lang.IllegalStateException - if state condition is falsepublic static void isValidPort(int port)
public static void isContained(java.lang.Object value,
java.lang.Object[] array,
java.lang.String message)
Copyright © JSCAPE LLC. 1999-2021. All Rights Reserved