Class AbstractMapAssert<T,U,V extends java.util.Map<T,U>,W extends GenericMapAssert<T,U,V,W>>
- java.lang.Object
-
- io.github.henryssondaniel.teacup.core.assertion.AbstractObjectAssert<T,U>
-
- io.github.henryssondaniel.teacup.core.assertion.AbstractMapAssert<T,U,V,W>
-
- Type Parameters:
T
- the key typeU
- the value typeV
- the map typeW
- the generic map assert type
- All Implemented Interfaces:
EnumerableAssert<V,W>
,GenericMapAssert<T,U,V,W>
,GenericObjectAssert<V,W>
public abstract class AbstractMapAssert<T,U,V extends java.util.Map<T,U>,W extends GenericMapAssert<T,U,V,W>> extends AbstractObjectAssert<T,U> implements GenericMapAssert<T,U,V,W>
Abstract map assert.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description AbstractMapAssert()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description W
contains(java.util.Map.Entry<? extends T,? extends U>... entries)
Verifies that the map contains the given entries, in any order.W
containsAllEntriesOf(java.util.Map<? extends T,? extends U> map)
Verifies that the map contains all the elements of the given map.W
containsAnyOf(java.util.Map.Entry<? extends T,? extends U>... entries)
Verifies that the map contains any of the given entries.W
containsEntry(T key, U value)
Verifies that the map contains the given key and value.W
containsExactly(java.util.Map.Entry<? extends T,? extends U>... entries)
Verifies that the map contains exactly the given entries.W
containsKey(T key)
Verifies that the map contains the given key.W
containsKeys(T... keys)
Verifies that the map contains the given keys.W
containsOnly(java.util.Map.Entry<? extends T,? extends U>... entries)
Verifies that the map only contains the given entries.W
containsOnlyKeys(T... keys)
Verifies that the map only contains the given keys.W
containsValue(U value)
Verifies that the map contains the given value.W
containsValues(U... values)
Verifies that the map contains the given values.W
doesNotContain(java.util.Map.Entry<? extends T,? extends U>... entries)
Verifies that the map does not contain the given entries.W
doesNotContainEntry(T key, U value)
Verifies that the map does not contain the given key and value.W
doesNotContainKey(T key)
Verifies that the map contains the given key.W
doesNotContainKeys(T... keys)
Verifies that the map contains the given keys.W
doesNotContainValue(U value)
Verifies that the map contains the given value.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.W
hasSameSizeAs(java.util.Map<?,?> map)
Verifies that the map has the same size as the given map.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.-
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 W contains(java.util.Map.Entry<? extends T,? extends U>... entries)
Description copied from interface:GenericMapAssert
Verifies that the map contains the given entries, in any order.
-
containsAllEntriesOf
public W containsAllEntriesOf(java.util.Map<? extends T,? extends U> map)
Description copied from interface:GenericMapAssert
Verifies that the map contains all the elements of the given map.- Specified by:
containsAllEntriesOf
in interfaceGenericMapAssert<T,U,V extends java.util.Map<T,U>,W extends GenericMapAssert<T,U,V,W>>
- Parameters:
map
- the map- Returns:
- the map assert
-
containsAnyOf
public W containsAnyOf(java.util.Map.Entry<? extends T,? extends U>... entries)
Description copied from interface:GenericMapAssert
Verifies that the map contains any of the given entries.- Specified by:
containsAnyOf
in interfaceGenericMapAssert<T,U,V extends java.util.Map<T,U>,W extends GenericMapAssert<T,U,V,W>>
- Parameters:
entries
- the entries- Returns:
- the map assert
-
containsEntry
public W containsEntry(T key, U value)
Description copied from interface:GenericMapAssert
Verifies that the map contains the given key and value.- Specified by:
containsEntry
in interfaceGenericMapAssert<T,U,V extends java.util.Map<T,U>,W extends GenericMapAssert<T,U,V,W>>
- Parameters:
key
- the keyvalue
- the value- Returns:
- the map assert
-
containsExactly
public W containsExactly(java.util.Map.Entry<? extends T,? extends U>... entries)
Description copied from interface:GenericMapAssert
Verifies that the map contains exactly the given entries.- Specified by:
containsExactly
in interfaceGenericMapAssert<T,U,V extends java.util.Map<T,U>,W extends GenericMapAssert<T,U,V,W>>
- Parameters:
entries
- the entries- Returns:
- the map assert
-
containsKey
public W containsKey(T key)
Description copied from interface:GenericMapAssert
Verifies that the map contains the given key.- Specified by:
containsKey
in interfaceGenericMapAssert<T,U,V extends java.util.Map<T,U>,W extends GenericMapAssert<T,U,V,W>>
- Parameters:
key
- the key- Returns:
- the map assert
-
containsKeys
public W containsKeys(T... keys)
Description copied from interface:GenericMapAssert
Verifies that the map contains the given keys.- Specified by:
containsKeys
in interfaceGenericMapAssert<T,U,V extends java.util.Map<T,U>,W extends GenericMapAssert<T,U,V,W>>
- Parameters:
keys
- the keys- Returns:
- the map assert
-
containsOnly
public W containsOnly(java.util.Map.Entry<? extends T,? extends U>... entries)
Description copied from interface:GenericMapAssert
Verifies that the map only contains the given entries.- Specified by:
containsOnly
in interfaceGenericMapAssert<T,U,V extends java.util.Map<T,U>,W extends GenericMapAssert<T,U,V,W>>
- Parameters:
entries
- the entries- Returns:
- the map assert
-
containsOnlyKeys
public W containsOnlyKeys(T... keys)
Description copied from interface:GenericMapAssert
Verifies that the map only contains the given keys.- Specified by:
containsOnlyKeys
in interfaceGenericMapAssert<T,U,V extends java.util.Map<T,U>,W extends GenericMapAssert<T,U,V,W>>
- Parameters:
keys
- the keys- Returns:
- the map assert
-
containsValue
public W containsValue(U value)
Description copied from interface:GenericMapAssert
Verifies that the map contains the given value.- Specified by:
containsValue
in interfaceGenericMapAssert<T,U,V extends java.util.Map<T,U>,W extends GenericMapAssert<T,U,V,W>>
- Parameters:
value
- the value- Returns:
- the map assert
-
containsValues
public W containsValues(U... values)
Description copied from interface:GenericMapAssert
Verifies that the map contains the given values.- Specified by:
containsValues
in interfaceGenericMapAssert<T,U,V extends java.util.Map<T,U>,W extends GenericMapAssert<T,U,V,W>>
- Parameters:
values
- the values- Returns:
- the map assert
-
doesNotContain
public W doesNotContain(java.util.Map.Entry<? extends T,? extends U>... entries)
Description copied from interface:GenericMapAssert
Verifies that the map does not contain the given entries.- Specified by:
doesNotContain
in interfaceGenericMapAssert<T,U,V extends java.util.Map<T,U>,W extends GenericMapAssert<T,U,V,W>>
- Parameters:
entries
- the entries- Returns:
- the map assert
-
doesNotContainEntry
public W doesNotContainEntry(T key, U value)
Description copied from interface:GenericMapAssert
Verifies that the map does not contain the given key and value.- Specified by:
doesNotContainEntry
in interfaceGenericMapAssert<T,U,V extends java.util.Map<T,U>,W extends GenericMapAssert<T,U,V,W>>
- Parameters:
key
- the keyvalue
- the value- Returns:
- the map assert
-
doesNotContainKey
public W doesNotContainKey(T key)
Description copied from interface:GenericMapAssert
Verifies that the map contains the given key.- Specified by:
doesNotContainKey
in interfaceGenericMapAssert<T,U,V extends java.util.Map<T,U>,W extends GenericMapAssert<T,U,V,W>>
- Parameters:
key
- the key- Returns:
- the map assert
-
doesNotContainKeys
public W doesNotContainKeys(T... keys)
Description copied from interface:GenericMapAssert
Verifies that the map contains the given keys.- Specified by:
doesNotContainKeys
in interfaceGenericMapAssert<T,U,V extends java.util.Map<T,U>,W extends GenericMapAssert<T,U,V,W>>
- Parameters:
keys
- the keys- Returns:
- the map assert
-
doesNotContainValue
public W doesNotContainValue(U value)
Description copied from interface:GenericMapAssert
Verifies that the map contains the given value.- Specified by:
doesNotContainValue
in interfaceGenericMapAssert<T,U,V extends java.util.Map<T,U>,W extends GenericMapAssert<T,U,V,W>>
- Parameters:
value
- the value- Returns:
- the map assert
-
hasSameSizeAs
public W hasSameSizeAs(java.util.Map<?,?> map)
Description copied from interface:GenericMapAssert
Verifies that the map has the same size as the given map.- Specified by:
hasSameSizeAs
in interfaceGenericMapAssert<T,U,V extends java.util.Map<T,U>,W extends GenericMapAssert<T,U,V,W>>
- Parameters:
map
- the map- Returns:
- the map 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
-
-