Class AbstractIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- java.lang.Object
-
- io.github.henryssondaniel.teacup.core.assertion.AbstractObjectAssert<T,U>
-
- io.github.henryssondaniel.teacup.core.assertion.AbstractIterableAssert<T,U,V>
-
- Type Parameters:
T
- the typeU
- the iterable typeV
- the generic iterable assert type
- All Implemented Interfaces:
EnumerableAssert<U,V>
,GenericIterableAssert<T,U,V>
,GenericObjectAssert<U,V>
- Direct Known Subclasses:
AbstractListAssert
public abstract class AbstractIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>> extends AbstractObjectAssert<T,U> implements GenericIterableAssert<T,U,V>
Abstract iterable assert.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description AbstractIterableAssert()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description V
contains(T... values)
Verifies that the iterable contains the given values, in any order.V
containsAll(java.lang.Iterable<? extends T> iterable)
Verifies that the iterable contains all the elements of the given iterable, in any order.V
containsAnyElementsOf(java.lang.Iterable<? extends T> iterable)
Verifies that the iterable contains any of the elements of the given iterable.V
containsAnyOf(T... values)
Verifies that the iterable contains any of the given values.V
containsExactly(T... values)
Verifies that the iterable contains exactly all the given values.V
containsExactlyElementsOf(java.lang.Iterable<? extends T> iterable)
Verifies that the iterable contains exactly the elements of the given iterable.V
containsExactlyInAnyOrder(T... values)
Verifies that the iterable contains exactly all the given values, in any order.V
containsExactlyInAnyOrderElementsOf(java.lang.Iterable<? extends T> values)
Verifies that the iterable contains exactly all of the elements of the given iterable, in any order.V
containsNull()
Verifies that the iterable contains at least one null element.V
containsOnly(T... values)
Verifies that the iterable only contains the given values.V
containsOnlyNulls()
Verifies that the iterable only contains null element.V
containsOnlyOnce(T... values)
Verifies that the iterable only contains the given values once.V
containsSequence(java.lang.Iterable<? extends T> sequence)
Verifies that the iterable contains the sequence of the given iterable.V
containsSequence(T... sequence)
Verifies that the iterable contains the given sequence.V
containsSubsequence(java.lang.Iterable<? extends T> subsequence)
Verifies that the iterable contains the subsequence of the given iterable.V
containsSubsequence(T... subsequence)
Verifies that the iterable contains the given subsequence.V
doesNotContain(T... values)
Verifies that the iterable does not contain the given values.V
doesNotContainAnyElementsOf(java.lang.Iterable<? extends T> iterable)
Verifies that the iterable does not contain any of the elements of the given iterable.V
doesNotContainNull()
Verifies that the iterable does not contain any null element.V
doesNotContainSequence(java.lang.Iterable<? extends T> sequence)
Verifies that the iterable does not contain the sequence of the given iterable.V
doesNotContainSequence(T... sequence)
Verifies that the iterable does not contain the given sequence.V
doesNotContainSubsequence(java.lang.Iterable<? extends T> subsequence)
Verifies that the iterable does not contain the subsequence of the given iterable.V
doesNotContainSubsequence(T... subsequence)
Verifies that the iterable does not contain the given subsequence.V
doesNotHaveAnyElementsOfTypes(java.lang.Class<?>... types)
Verifies that the iterable does not have any elements of the given types.V
doesNotHaveDuplicates()
Verifies that the iterable does not have duplicates.V
endsWith(T... sequence)
Verifies that the iterable ends with the given sequence.V
hasAtLeastOneElementOfType(java.lang.Class<?> type)
Verifies that the iterable has at least one element of the given type.V
hasOnlyElementsOfType(java.lang.Class<?> type)
Verifies that the iterable has only elements of the given type.V
hasOnlyElementsOfTypes(java.lang.Class<?>... types)
Verifies that the iterable has only elements of the given types.V
hasSameElementsAs(java.lang.Iterable<? extends T> iterable)
Verifies that the iterable has same elements as the given iterable.U
hasSameSizeAs(java.lang.Iterable<?> other)
Verifies that the enumerable has the same size as the other.U
hasSameSizeAs(java.lang.Object array)
Verifies that the enumerable has the same size as the array.U
hasSize(int expected)
Verifies that the enumerable has the expected size.U
isEmpty()
Verifies that the enumerable is empty.U
isNotEmpty()
Verifies that the enumerable is not empty.U
isNullOrEmpty()
Verifies that the enumerable is null or empty.V
isSubsetOf(java.lang.Iterable<? extends T> iterable)
Verifies that the iterable is a subset of the given iterable.V
isSubsetOf(T... values)
Verifies that the iterable is a subset of the given values.V
startsWith(T... sequence)
Verifies that the iterable starts with the given sequence.-
Methods inherited from class io.github.henryssondaniel.teacup.core.assertion.AbstractObjectAssert
doesNotHaveSameClassAs, hasSameClassAs, isEqualTo, isNotEqualTo, isNotSameAs, isSameAs, verify
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.github.henryssondaniel.teacup.core.assertion.EnumerableAssert
hasSameSizeAs, hasSameSizeAs, hasSize, isEmpty, isNotEmpty, isNullOrEmpty
-
Methods inherited from interface io.github.henryssondaniel.teacup.core.assertion.GenericObjectAssert
doesNotHaveSameClassAs, hasSameClassAs, isEqualTo, isNotEqualTo, isNotSameAs, isSameAs, verify
-
-
-
-
Method Detail
-
contains
public V contains(T... values)
Description copied from interface:GenericIterableAssert
Verifies that the iterable contains the given values, in any order.- Specified by:
contains
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
values
- the values- Returns:
- the iterable assert
-
containsAll
public V containsAll(java.lang.Iterable<? extends T> iterable)
Description copied from interface:GenericIterableAssert
Verifies that the iterable contains all the elements of the given iterable, in any order.- Specified by:
containsAll
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
iterable
- the iterable- Returns:
- the iterable assert
-
containsAnyElementsOf
public V containsAnyElementsOf(java.lang.Iterable<? extends T> iterable)
Description copied from interface:GenericIterableAssert
Verifies that the iterable contains any of the elements of the given iterable.- Specified by:
containsAnyElementsOf
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
iterable
- the iterable- Returns:
- the iterable assert
-
containsAnyOf
public V containsAnyOf(T... values)
Description copied from interface:GenericIterableAssert
Verifies that the iterable contains any of the given values.- Specified by:
containsAnyOf
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
values
- the value- Returns:
- the iterable assert
-
containsExactly
public V containsExactly(T... values)
Description copied from interface:GenericIterableAssert
Verifies that the iterable contains exactly all the given values.- Specified by:
containsExactly
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
values
- the values- Returns:
- the iterable assert
-
containsExactlyElementsOf
public V containsExactlyElementsOf(java.lang.Iterable<? extends T> iterable)
Description copied from interface:GenericIterableAssert
Verifies that the iterable contains exactly the elements of the given iterable.- Specified by:
containsExactlyElementsOf
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
iterable
- the iterable- Returns:
- the iterable assert
-
containsExactlyInAnyOrder
public V containsExactlyInAnyOrder(T... values)
Description copied from interface:GenericIterableAssert
Verifies that the iterable contains exactly all the given values, in any order.- Specified by:
containsExactlyInAnyOrder
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
values
- the values- Returns:
- the iterable assert
-
containsExactlyInAnyOrderElementsOf
public V containsExactlyInAnyOrderElementsOf(java.lang.Iterable<? extends T> values)
Description copied from interface:GenericIterableAssert
Verifies that the iterable contains exactly all of the elements of the given iterable, in any order.- Specified by:
containsExactlyInAnyOrderElementsOf
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
values
- the values- Returns:
- the iterable assert
-
containsNull
public V containsNull()
Description copied from interface:GenericIterableAssert
Verifies that the iterable contains at least one null element.- Specified by:
containsNull
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Returns:
- the iterable assert
-
containsOnly
public V containsOnly(T... values)
Description copied from interface:GenericIterableAssert
Verifies that the iterable only contains the given values.- Specified by:
containsOnly
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
values
- the values- Returns:
- the iterable assert
-
containsOnlyNulls
public V containsOnlyNulls()
Description copied from interface:GenericIterableAssert
Verifies that the iterable only contains null element.- Specified by:
containsOnlyNulls
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Returns:
- the iterable assert
-
containsOnlyOnce
public V containsOnlyOnce(T... values)
Description copied from interface:GenericIterableAssert
Verifies that the iterable only contains the given values once.- Specified by:
containsOnlyOnce
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
values
- the values- Returns:
- the iterable assert
-
containsSequence
public V containsSequence(T... sequence)
Description copied from interface:GenericIterableAssert
Verifies that the iterable contains the given sequence.- Specified by:
containsSequence
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
sequence
- the sequence- Returns:
- the iterable assert
-
containsSequence
public V containsSequence(java.lang.Iterable<? extends T> sequence)
Description copied from interface:GenericIterableAssert
Verifies that the iterable contains the sequence of the given iterable.- Specified by:
containsSequence
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
sequence
- the sequence- Returns:
- the iterable assert
-
containsSubsequence
public V containsSubsequence(T... subsequence)
Description copied from interface:GenericIterableAssert
Verifies that the iterable contains the given subsequence.- Specified by:
containsSubsequence
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
subsequence
- the subsequence- Returns:
- the iterable assert
-
containsSubsequence
public V containsSubsequence(java.lang.Iterable<? extends T> subsequence)
Description copied from interface:GenericIterableAssert
Verifies that the iterable contains the subsequence of the given iterable.- Specified by:
containsSubsequence
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
subsequence
- the subsequence- Returns:
- the iterable assert
-
doesNotContain
public V doesNotContain(T... values)
Description copied from interface:GenericIterableAssert
Verifies that the iterable does not contain the given values.- Specified by:
doesNotContain
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
values
- the values- Returns:
- the iterable assert
-
doesNotContainAnyElementsOf
public V doesNotContainAnyElementsOf(java.lang.Iterable<? extends T> iterable)
Description copied from interface:GenericIterableAssert
Verifies that the iterable does not contain any of the elements of the given iterable.- Specified by:
doesNotContainAnyElementsOf
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
iterable
- the iterable- Returns:
- the iterable assert
-
doesNotContainNull
public V doesNotContainNull()
Description copied from interface:GenericIterableAssert
Verifies that the iterable does not contain any null element.- Specified by:
doesNotContainNull
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Returns:
- the iterable assert
-
doesNotContainSequence
public V doesNotContainSequence(T... sequence)
Description copied from interface:GenericIterableAssert
Verifies that the iterable does not contain the given sequence.- Specified by:
doesNotContainSequence
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
sequence
- the sequence- Returns:
- the iterable assert
-
doesNotContainSequence
public V doesNotContainSequence(java.lang.Iterable<? extends T> sequence)
Description copied from interface:GenericIterableAssert
Verifies that the iterable does not contain the sequence of the given iterable.- Specified by:
doesNotContainSequence
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
sequence
- the sequence- Returns:
- the iterable assert
-
doesNotContainSubsequence
public V doesNotContainSubsequence(T... subsequence)
Description copied from interface:GenericIterableAssert
Verifies that the iterable does not contain the given subsequence.- Specified by:
doesNotContainSubsequence
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
subsequence
- the subsequence- Returns:
- the iterable assert
-
doesNotContainSubsequence
public V doesNotContainSubsequence(java.lang.Iterable<? extends T> subsequence)
Description copied from interface:GenericIterableAssert
Verifies that the iterable does not contain the subsequence of the given iterable.- Specified by:
doesNotContainSubsequence
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
subsequence
- the subsequence- Returns:
- the iterable assert
-
doesNotHaveAnyElementsOfTypes
public V doesNotHaveAnyElementsOfTypes(java.lang.Class<?>... types)
Description copied from interface:GenericIterableAssert
Verifies that the iterable does not have any elements of the given types.- Specified by:
doesNotHaveAnyElementsOfTypes
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
types
- the types- Returns:
- the iterable assert
-
doesNotHaveDuplicates
public V doesNotHaveDuplicates()
Description copied from interface:GenericIterableAssert
Verifies that the iterable does not have duplicates.- Specified by:
doesNotHaveDuplicates
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Returns:
- the iterable assert
-
endsWith
public V endsWith(T... sequence)
Description copied from interface:GenericIterableAssert
Verifies that the iterable ends with the given sequence.- Specified by:
endsWith
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
sequence
- the sequence- Returns:
- the iterable assert
-
hasAtLeastOneElementOfType
public V hasAtLeastOneElementOfType(java.lang.Class<?> type)
Description copied from interface:GenericIterableAssert
Verifies that the iterable has at least one element of the given type.- Specified by:
hasAtLeastOneElementOfType
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
type
- the type- Returns:
- the iterable assert
-
hasOnlyElementsOfType
public V hasOnlyElementsOfType(java.lang.Class<?> type)
Description copied from interface:GenericIterableAssert
Verifies that the iterable has only elements of the given type.- Specified by:
hasOnlyElementsOfType
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
type
- type- Returns:
- the iterable assert
-
hasOnlyElementsOfTypes
public V hasOnlyElementsOfTypes(java.lang.Class<?>... types)
Description copied from interface:GenericIterableAssert
Verifies that the iterable has only elements of the given types.- Specified by:
hasOnlyElementsOfTypes
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
types
- the types- Returns:
- the iterable assert
-
hasSameElementsAs
public V hasSameElementsAs(java.lang.Iterable<? extends T> iterable)
Description copied from interface:GenericIterableAssert
Verifies that the iterable has same elements as the given iterable.- Specified by:
hasSameElementsAs
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
iterable
- the iterable- Returns:
- the iterable assert
-
isSubsetOf
public V isSubsetOf(T... values)
Description copied from interface:GenericIterableAssert
Verifies that the iterable is a subset of the given values.- Specified by:
isSubsetOf
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
values
- the values- Returns:
- the iterable assert
-
isSubsetOf
public V isSubsetOf(java.lang.Iterable<? extends T> iterable)
Description copied from interface:GenericIterableAssert
Verifies that the iterable is a subset of the given iterable.- Specified by:
isSubsetOf
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
iterable
- the iterable- Returns:
- the iterable assert
-
startsWith
public V startsWith(T... sequence)
Description copied from interface:GenericIterableAssert
Verifies that the iterable starts with the given sequence.- Specified by:
startsWith
in interfaceGenericIterableAssert<T,U extends java.lang.Iterable<? extends T>,V extends GenericIterableAssert<T,U,V>>
- Parameters:
sequence
- the sequence- Returns:
- the iterable assert
-
hasSameSizeAs
public U hasSameSizeAs(java.lang.Iterable<?> other)
Description copied from interface:EnumerableAssert
Verifies that the enumerable has the same size as the other.- Specified by:
hasSameSizeAs
in interfaceEnumerableAssert<T,U extends EnumerableAssert<T,U>>
- Parameters:
other
- the other- Returns:
- the enumerable assert
-
hasSameSizeAs
public U hasSameSizeAs(java.lang.Object array)
Description copied from interface:EnumerableAssert
Verifies that the enumerable has the same size as the array.- Specified by:
hasSameSizeAs
in interfaceEnumerableAssert<T,U extends EnumerableAssert<T,U>>
- Parameters:
array
- the other- Returns:
- the enumerable assert
-
hasSize
public U hasSize(int expected)
Description copied from interface:EnumerableAssert
Verifies that the enumerable has the expected size.- Specified by:
hasSize
in interfaceEnumerableAssert<T,U extends EnumerableAssert<T,U>>
- Parameters:
expected
- the array- Returns:
- the enumerable assert
-
isEmpty
public U isEmpty()
Description copied from interface:EnumerableAssert
Verifies that the enumerable is empty.- Specified by:
isEmpty
in interfaceEnumerableAssert<T,U extends EnumerableAssert<T,U>>
- Returns:
- the enumerable assert
-
isNotEmpty
public U isNotEmpty()
Description copied from interface:EnumerableAssert
Verifies that the enumerable is not empty.- Specified by:
isNotEmpty
in interfaceEnumerableAssert<T,U extends EnumerableAssert<T,U>>
- Returns:
- the enumerable assert
-
isNullOrEmpty
public U isNullOrEmpty()
Description copied from interface:EnumerableAssert
Verifies that the enumerable is null or empty.- Specified by:
isNullOrEmpty
in interfaceEnumerableAssert<T,U extends EnumerableAssert<T,U>>
- Returns:
- the enumerable assert
-
-