Class IterableExaminer
java.lang.Object
ch.nolix.base.commontypetool.iterableexaminer.IterableExaminer
- All Implemented Interfaces:
IIterableContainExaminer, IIterableContainMatchingExaminer, IIterableContainMultipleObjectExaminer, IIterableContainObjectExaminer, IIterableExaminer
- Author:
- Silvan Wyss
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleancontainsAll(Iterable<?> iterable, Iterable<?> objects) booleancontainsAll(Iterable<? extends Object> iterable, Object... objects) booleancontainsAny(Iterable<?> iterable) booleancontainsAny(Iterable<?> iterable, Iterable<?> objects) booleancontainsAny(Iterable<?> iterable, Object... objects) booleancontainsExactlyAll(Iterable<?> iterable, Iterable<?> objects) booleancontainsExactlyAll(Iterable<?> iterable, Object... objects) booleancontainsExactlyAllInSameOrder(Iterable<?> iterable, Iterable<?> objects) booleancontainsExactlyAllInSameOrder(Iterable<?> iterable, Object... objects) <T> booleancontainsMatching(Iterable<T> iterable, Predicate<T> selector) <T> booleancontainsMatchingOnly(Iterable<T> iterable, Predicate<T> selector) booleancontainsNone(Iterable<?> iterable, Iterable<?> objects) booleancontainsNone(Iterable<?> iterable, Object... objects) booleancontainsNonNull(Iterable<?> iterable) booleancontainsOnce(Iterable<?> iterable, Object object) <T> booleancontainsOneMatching(Iterable<T> iterable, Predicate<T> selector) booleancontainsOnly(Iterable<?> iterable, Object object) boolean
-
Constructor Details
-
IterableExaminer
public IterableExaminer()
-
-
Method Details
-
contains
- Specified by:
containsin interfaceIIterableContainObjectExaminer- Parameters:
iterable- the searchedIterable, is considered to be empty when is nullobject-- Returns:
- true if the given iterable contains the given object, false otherwise
-
containsAll
- Specified by:
containsAllin interfaceIIterableContainMultipleObjectExaminer- Parameters:
iterable- the searchedIterable, is considered to be empty when is nullobjects- the searched forObjects, is considered to be empty when is null- Returns:
- true if the given iterable contains all of the given objects, false otherwise
-
containsAll
- Specified by:
containsAllin interfaceIIterableContainMultipleObjectExaminer- Parameters:
iterable- the searchedIterable, is considered to be empty when is nullobjects- the searched forObjects, is considered to be empty when is null- Returns:
- true if the given iterable contains all of the given objects, false otherwise
-
containsAny
- Specified by:
containsAnyin interfaceIIterableContainExaminer- Parameters:
iterable- the searchedIterable, is considered to be empty when is null- Returns:
- true if the given iterable contains an element, false otherwise
-
containsAny
- Specified by:
containsAnyin interfaceIIterableContainMultipleObjectExaminer- Parameters:
iterable- the searchedIterable, is considered to be empty when is nullobjects- the searched forObjects, is considered to be empty when is null- Returns:
- true if the given iterable contains any of the given objects, false otherwise
-
containsAny
- Specified by:
containsAnyin interfaceIIterableContainMultipleObjectExaminer- Parameters:
iterable- the searchedIterable, is considered to be empty when is nullobjects- the searched forObjects, is considered to be empty when is null- Returns:
- true if the given iterable contains any of the given objects, false otherwise
-
containsExactlyAll
- Specified by:
containsExactlyAllin interfaceIIterableContainMultipleObjectExaminer- Parameters:
iterable- the searchedIterable, is considered to be empty when is nullobjects- the searched forObjects, is considered to be empty when is null- Returns:
- true if the given iterable contains exactly all the given objects, false otherwise
-
containsExactlyAll
- Specified by:
containsExactlyAllin interfaceIIterableContainMultipleObjectExaminer- Parameters:
iterable- the searchedIterable, is considered to be empty when is nullobjects- the searched forObjects, is considered to be empty when is null- Returns:
- true if the given iterable contains exactly all the given objects, false otherwise
-
containsExactlyAllInSameOrder
- Specified by:
containsExactlyAllInSameOrderin interfaceIIterableContainMultipleObjectExaminer- Parameters:
iterable- the searchedIterable, is considered to be empty when is nullobjects- the searched forObjects, is considered to be empty when is null- Returns:
- true if the given iterable contains exactly all the given objects in the same order, false otherwise
-
containsExactlyAllInSameOrder
- Specified by:
containsExactlyAllInSameOrderin interfaceIIterableContainMultipleObjectExaminer- Parameters:
iterable- the searchedIterable, is considered to be empty when is nullobjects- the searched forObjects, is considered to be empty when is null- Returns:
- true if the given iterable contains exactly all the given objects in the same order, false otherwise
-
containsMatching
- Specified by:
containsMatchingin interfaceIIterableContainMatchingExaminer- Type Parameters:
T- the type of the elements of the given iterable- Parameters:
iterable- the searchedIterable, is considered to be empty when is nullselector- can select elements, is considered not to select any element when is null- Returns:
- true if the given iterable contains an element the given selector selects, false otherwise. Ignores null elements in the given iterable.
-
containsMatchingOnly
- Specified by:
containsMatchingOnlyin interfaceIIterableContainMatchingExaminer- Type Parameters:
T- the type of the elements of the given iterable- Parameters:
iterable- the searchedIterable, is considered to be empty when is nullselector- can select elements, is considered not to select any element when is null- Returns:
- true if the given iterable contains only elements the given selector selects, false otherwise. Ignores null elements in the given iterable.
-
containsNone
- Specified by:
containsNonein interfaceIIterableContainMultipleObjectExaminer- Parameters:
iterable- the searchedIterable, is considered to be empty when is nullobjects- the searched forObjects, is considered to be empty when is null- Returns:
- true if the given iterable does not contain any of the given objects, false otherwise
-
containsNone
- Specified by:
containsNonein interfaceIIterableContainMultipleObjectExaminer- Parameters:
iterable- the searchedIterable, is considered to be empty when is nullobjects- the searched forObjects, is considered to be empty when is null- Returns:
- true if the given iterable does not contain any of the given objects, false otherwise
-
containsNonNull
- Specified by:
containsNonNullin interfaceIIterableContainExaminer- Parameters:
iterable- the searchedIterable, is considered to be empty when is null- Returns:
- true if the given iterable contains a non-null element, false otherwise.
-
containsOnce
- Specified by:
containsOncein interfaceIIterableContainObjectExaminer- Parameters:
iterable- the searchedIterable, is considered to be empty when is nullobject-- Returns:
- true if the given iterable contains the given object exactly 1 time, false otherwise
-
containsOneMatching
- Specified by:
containsOneMatchingin interfaceIIterableContainMatchingExaminer- Type Parameters:
T- the type of the elements of the given iterable- Parameters:
iterable- the searchedIterable, is considered to be empty when is nullselector- can select elements, is considered not to select any element when is null- Returns:
- true if the given iterable contains exactly 1 element the given selector selects, false otherwise. Ignores null elements in the given iterable.
-
containsOnly
- Specified by:
containsOnlyin interfaceIIterableContainObjectExaminer- Parameters:
iterable- the searchedIterable, is considered to be empty when is nullobject-- Returns:
- true if the given iterable contains only the given object, whether 1 or several times, false otherwise
-
isEmpty
- Specified by:
isEmptyin interfaceIIterableContainExaminer- Parameters:
iterable- the searchedIterable, is considered to be empty when is null- Returns:
- true if the given iterable is empty, false otherwise
-