Top Description Inners Constructors Methods
org.eclipse.persistence.jpa.jpql

public final Class Assert

extends Object
Class Inheritance

An utility class that provides various checks and when the condition fails, then an AssertException is thrown.
Author
Pascal Filion
Since
2.4
Version
2.4

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Assert.AssertException

The exception thrown when the condition is not met.

Constructor Summary

AccessConstructor and Description
private
Assert()

Prevents instantiation.

Method Summary

Modifier and TypeMethod and Description
public static void
fail(String
The message to display
message
)

Throws an AssertException immediately.

public static void
isEqual(Object
The first object used to be compared to the second object
object1
,
Object
The second object used to be compared to the first object
object2
,
String
The expression's message that will describe the reason why the check failed
message
)

Determines whether the given two objects are equal (identity).

public static void
isFalse(boolean
The condition to verify it is false
condition
,
String
The expression's message that will describe the reason why the check failed
message
)

Determines whether the given condition if false or true and if it is true then an AssertException is thrown.

public static void
isNotNull(Object
The value to check to not be null
object
,
String
The expression's message that will describe the reason why the check failed
message
)

Determines whether the given object is not null.

public static void
isNull(Object
The value to check to be null
object
,
String
The expression's message that will describe the reason why the check failed
message
)

Determines whether the given object is null.

public static void
isTrue(boolean
The condition to verify it is true
condition
,
String
The expression's message that will describe the reason why the check failed
message
)

Determines whether the given condition if true or false and if it is false then an AssertException is thrown.

public static void
isValid(Object
The object to find in the list of choices
object
,
String
The expression's message that will describe the reason why the check failed
message
,
Object...
The list of valid choices
choices
)

Determines whether the given object is one of the given choices using identity check.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Assertback to summary
private Assert()

Prevents instantiation.

Method Detail

failback to summary
public static void fail(String message)

Throws an AssertException immediately.

Parameters
message:String

The message to display

isEqualback to summary
public static void isEqual(Object object1, Object object2, String message)

Determines whether the given two objects are equal (identity). If the two objects are not identical, then an AssertException is thrown

Parameters
object1:Object

The first object used to be compared to the second object

object2:Object

The second object used to be compared to the first object

message:String

The expression's message that will describe the reason why the check failed

isFalseback to summary
public static void isFalse(boolean condition, String message)

Determines whether the given condition if false or true and if it is true then an AssertException is thrown.

Parameters
condition:boolean

The condition to verify it is false

message:String

The expression's message that will describe the reason why the check failed

isNotNullback to summary
public static void isNotNull(Object object, String message)

Determines whether the given object is not null. If the object is null, then an NullPointerException is thrown

Parameters
object:Object

The value to check to not be null

message:String

The expression's message that will describe the reason why the check failed

isNullback to summary
public static void isNull(Object object, String message)

Determines whether the given object is null. If the object is not null, then an AssertException is thrown

Parameters
object:Object

The value to check to be null

message:String

The expression's message that will describe the reason why the check failed

isTrueback to summary
public static void isTrue(boolean condition, String message)

Determines whether the given condition if true or false and if it is false then an AssertException is thrown.

Parameters
condition:boolean

The condition to verify it is true

message:String

The expression's message that will describe the reason why the check failed

isValidback to summary
public static void isValid(Object object, String message, Object... choices)

Determines whether the given object is one of the given choices using identity check.

Parameters
object:Object

The object to find in the list of choices

message:String

The expression's message that will describe the reason why the check failed

choices:Object[]

The list of valid choices

org.eclipse.persistence.jpa.jpql back to summary

public Class Assert.AssertException

extends RuntimeException
Class Inheritance

The exception thrown when the condition is not met.

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
AssertException(String
The message describing the reason why this exception is thrown
message
)

Creates a new AssertException.

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.RuntimeException.serialVersionUID.

Constructor Detail

AssertExceptionback to summary
public AssertException(String message)

Creates a new AssertException.

Parameters
message:String

The message describing the reason why this exception is thrown