public static class Ensure.CollectionCondition extends Ensure.IterableCondition
| Constructor and Description |
|---|
CollectionCondition(Collection<?> value)
Creates a new instance of
CollectionCondition. |
| Modifier and Type | Method and Description |
|---|---|
void |
contains(Object element)
Ensures that the given collection is not
null and contains the specified element. |
void |
contains(Object element,
String explanation,
Object... args)
Ensures that the given collection is not
null and contains the specified element. |
void |
doesNotContain(Object element)
Ensures that the given collection is not
null and does not contain the specified element. |
void |
doesNotContain(Object element,
String explanation,
Object... args)
Ensures that the given collection is not
null and does not contain the specified element. |
isNotEmpty, isNotEmptyisInstanceOf, isInstanceOf, isNotNull, isNotNull, isNull, isNullpublic CollectionCondition(@CheckForNull
Collection<?> value)
CollectionCondition.value - value of the conditionpublic void contains(Object element)
null and contains the specified element.element - the element to findAssertionError - if the collection is null or if the specified element is not found@FormatMethod public void contains(Object element, String explanation, Object... args)
null and contains the specified element.element - the element to findexplanation - a formatted message explaining the assertionargs - Arguments referenced by the format specifiers in the formatted explanation. If there are more
arguments than format specifiers, the extra arguments are ignored. The number of arguments is
variable and may be zero.AssertionError - if the collection is null or if the specified element is not foundpublic void doesNotContain(Object element)
null and does not contain the specified element.element - the element that must not be in the collectionAssertionError - if the collection is null or if the specified element is part of the collection@FormatMethod public void doesNotContain(Object element, String explanation, Object... args)
null and does not contain the specified element.element - the element that must not be in the collectionexplanation - a formatted message explaining the assertionargs - Arguments referenced by the format specifiers in the formatted explanation. If there are more
arguments than format specifiers, the extra arguments are ignored. The number of arguments is
variable and may be zero.AssertionError - if the collection is null or if the specified element is part of the collectionCopyright © 2018. All rights reserved.