Kanzi  3.9.7
Java API
Assert Class Reference

A class that can be used to analyze the correctness of the program's behavior. More...

Classes

interface  StringFactory
 Interface for a callback which returns the message string to be attached to an assertion error. More...
 

Static Public Member Functions

static void NotNull (Object object, StringFactory stringFactory)
 Throws AssertionError if the given object is null. More...
 
static void Null (Object object, StringFactory stringFactory)
 Throws AssertionError if the given object is not null. More...
 
static void Throw (String message)
 Throws AssertionError with the given message. More...
 
static void True (boolean condition, StringFactory stringFactory)
 Throws AssertionError if the given condition is false. More...
 

Detailed Description

A class that can be used to analyze the correctness of the program's behavior.

Member Function Documentation

static void NotNull ( Object  object,
StringFactory  stringFactory 
)
static

Throws AssertionError if the given object is null.

Parameters
objectThe object to check.
stringFactoryA callback which returns the message string to be attached to the error.
static void Null ( Object  object,
StringFactory  stringFactory 
)
static

Throws AssertionError if the given object is not null.

Parameters
objectThe object to check.
stringFactoryA callback which returns the message string to be attached to the error.
static void Throw ( String  message)
static

Throws AssertionError with the given message.

Parameters
messageThe message to attach to the error.
static void True ( boolean  condition,
StringFactory  stringFactory 
)
static

Throws AssertionError if the given condition is false.

Parameters
conditionThe condition to evaluate.
stringFactoryA callback which returns the message string to be attached to the error.