Package com.mongodb.assertions
Class Assertions
java.lang.Object
com.mongodb.assertions.Assertions
Deprecated.
Usage of this API is not supported in AEM as a Cloud Service.
Design by contract assertions.
This class is not part of the public API and may be removed or changed at any time.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
doesNotContainNull
(String name, Collection<?> collection) Deprecated.Throw IllegalArgumentException if the collection contains a null value.static void
Deprecated.Throw IllegalStateException if the condition if false.static void
isTrue
(String name, boolean condition, SingleResultCallback<?> callback) Deprecated.Throw IllegalStateException if the condition if false.static void
isTrueArgument
(String name, boolean condition) Deprecated.Throw IllegalArgumentException if the condition if false.static <T> T
Deprecated.Throw IllegalArgumentException if the value is null.static <T> T
notNull
(String name, T value, SingleResultCallback<?> callback) Deprecated.Throw IllegalArgumentException if the value is null.
-
Method Details
-
notNull
Deprecated.Throw IllegalArgumentException if the value is null.- Type Parameters:
T
- the value type- Parameters:
name
- the parameter namevalue
- the value that should not be null- Returns:
- the value
- Throws:
IllegalArgumentException
- if value is null
-
notNull
Deprecated.Throw IllegalArgumentException if the value is null.- Type Parameters:
T
- the value type- Parameters:
name
- the parameter namevalue
- the value that should not be nullcallback
- the callback that also is passed the exception if the value is null- Returns:
- the value
- Throws:
IllegalArgumentException
- if value is null
-
isTrue
Deprecated.Throw IllegalStateException if the condition if false.- Parameters:
name
- the name of the state that is being checkedcondition
- the condition about the parameter to check- Throws:
IllegalStateException
- if the condition is false
-
isTrue
Deprecated.Throw IllegalStateException if the condition if false.- Parameters:
name
- the name of the state that is being checkedcondition
- the condition about the parameter to checkcallback
- the callback that also is passed the exception if the condition is not true- Throws:
IllegalStateException
- if the condition is false
-
isTrueArgument
Deprecated.Throw IllegalArgumentException if the condition if false.- Parameters:
name
- the name of the state that is being checkedcondition
- the condition about the parameter to check- Throws:
IllegalArgumentException
- if the condition is false
-
doesNotContainNull
Deprecated.Throw IllegalArgumentException if the collection contains a null value.- Parameters:
name
- the name of the collectioncollection
- the collection- Throws:
IllegalArgumentException
- if the collection contains a null value
-