Package org.eclipse.persistence.jpa.jpql
Class Assert
java.lang.Object
org.eclipse.persistence.jpa.jpql.Assert
An utility class that provides various checks and when the condition fails, then an
Assert.AssertException is thrown.- Version:
- 2.4
- Author:
- Pascal Filion
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe exception thrown when the condition is not met. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidThrows anAssert.AssertExceptionimmediately.static voidDetermines whether the given two objects are equal (identity).static voidDetermines whether the given condition iffalseortrueand if it istruethen anAssert.AssertExceptionis thrown.static voidDetermines whether the given object is notnull.static voidDetermines whether the given object isnull.static voidDetermines whether the given condition iftrueorfalseand if it isfalsethen anAssert.AssertExceptionis thrown.static voidDetermines whether the given object is one of the given choices using identity check.
-
Method Details
-
fail
Throws anAssert.AssertExceptionimmediately.- Parameters:
message- The message to display
-
isEqual
Determines whether the given two objects are equal (identity). If the two objects are not identical, then anAssert.AssertExceptionis thrown- Parameters:
object1- The first object used to be compared to the second objectobject2- The second object used to be compared to the first objectmessage- The expression's message that will describe the reason why the check failed
-
isFalse
Determines whether the given condition iffalseortrueand if it istruethen anAssert.AssertExceptionis thrown.- Parameters:
condition- The condition to verify it isfalsemessage- The expression's message that will describe the reason why the check failed
-
isNotNull
Determines whether the given object is notnull. If the object isnull, then anNullPointerExceptionis thrown- Parameters:
object- The value to check to not benullmessage- The expression's message that will describe the reason why the check failed
-
isNull
Determines whether the given object isnull. If the object is notnull, then anAssert.AssertExceptionis thrown- Parameters:
object- The value to check to benullmessage- The expression's message that will describe the reason why the check failed
-
isTrue
Determines whether the given condition iftrueorfalseand if it isfalsethen anAssert.AssertExceptionis thrown.- Parameters:
condition- The condition to verify it istruemessage- The expression's message that will describe the reason why the check failed
-
isValid
Determines whether the given object is one of the given choices using identity check.- Parameters:
object- The object to find in the list of choicesmessage- The expression's message that will describe the reason why the check failedchoices- The list of valid choices
-