|
Service Activator Toolkit
Version 1.1.0 (20081206) |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.soda.sat.core.util.Assertion
public final class Assertion
The Assertion
class provides static method for common assertions.
Method Summary | |
---|---|
static void |
checkArgumentIsNotNull(Object value,
String name)
Check whether the specified value argument is not null . |
static void |
checkArrayIsNotEmpty(Object value,
String name)
Check whether the specified array is not empty. |
static void |
checkIsNotNull(Object value,
String messageKey)
Check whether the specified value is not null . |
static void |
checkIsNotNull(Object value,
String messageKey,
Object messageParameter)
Check whether the specified value is not null . |
static void |
checkRange(long value,
String name,
long beginRange,
long endRange)
Check whether the specified value is with the specified begin and end range. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void checkArgumentIsNotNull(Object value, String name) throws IllegalArgumentException
null
.
value
- An Object
that must not be null
.name
- The name of the argument.
IllegalArgumentException
- when the argument is null
.public static void checkArrayIsNotEmpty(Object value, String name) throws IllegalArgumentException
value
- An Object[]
that must not be empty.name
- The name of the argument.
IllegalArgumentException
- when the array is empty.public static void checkIsNotNull(Object value, String messageKey) throws IllegalArgumentException
null
. If the value
is null
, display the message associated with the specified
message key.
value
- An Object
that must not be
null
.messageKey
- The key of a message to display if the value is
null
.
IllegalArgumentException
- when the value is null
.public static void checkIsNotNull(Object value, String messageKey, Object messageParameter) throws IllegalArgumentException
null
. If the value
is null
, display the message associated with the specified
message key and message parameter.
value
- An Object
that must not be
null
.messageKey
- The key of a message to display if the value is
null
.messageParameter
- The value to replace {0}
place
holder in the message.
IllegalArgumentException
- when the value is null
.public static void checkRange(long value, String name, long beginRange, long endRange) throws IllegalArgumentException
value
- An number.name
- The name for the number.beginRange
- The begin range.endRange
- The end range.
IllegalArgumentException
- when the value is not within the begin
and end range.
|
Service Activator Toolkit
Version 1.1.0 (20081206) |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2001, 2008 IBM Corporation and others. All Rights Reserved.