|
Secure iNet Factory | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jscape.util.Assert
public final class Assert
The utility class for various run-time verifications. It is intended to use as standard "assert" keyword for method parameter verification. DO NOT USE IT FOR OTHER PURPOSES!!!
Method Summary | |
---|---|
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 . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void notNull(java.lang.Object reference, java.lang.String message)
null
.
reference
- the reference to checkmessage
- the error message
java.lang.NullPointerException
- if the specified reference is null
public static void notNull(java.lang.Object reference)
null
.
reference
- the reference to check
java.lang.NullPointerException
- if the specified reference is null
public static void isTrue(boolean condition, java.lang.String message)
condition
- the condition to checkmessage
- the error message
java.lang.IllegalArgumentException
- if the specified condition is falsepublic static void isFalse(boolean condition, java.lang.String message)
condition
- the condition to checkmessage
- the error message
java.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 message
java.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 message
java.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 message
java.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 message
java.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 message
java.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 message
java.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 message
java.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 message
java.lang.IllegalArgumentException
- if the specified objects are not equal
java.lang.NullPointerException
- if some of the objects are null
public static void isValidArray(byte[] array, int offset, int len)
array
- the array to checkoffset
- the array offsetlen
- the data length
java.lang.IllegalArgumentException
- if the offset or length parameters are invalid
java.lang.NullPointerException
- if the array reference is null
public static void isValidString(java.lang.String str)
str
- string to check
java.lang.IllegalArgumentException
- if the string is empty
java.lang.NullPointerException
- if the string reference is null
public static void isValidState(boolean condition, java.lang.String message)
condition
- state condition to checkmessage
- error message
java.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)
|
Secure iNet Factory | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |