Package com.google.common.truth
Class MapSubject<S extends MapSubject<S,K,V,M>,K,V,M extends Map<K,V>>
- java.lang.Object
-
- com.google.common.truth.Subject<S,M>
-
- com.google.common.truth.MapSubject<S,K,V,M>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceMapSubject.WithValue<V>Deprecated.UsecontainsEntry(Object, Object)instead.-
Nested classes/interfaces inherited from class com.google.common.truth.Subject
Subject.HasField
-
-
Field Summary
-
Fields inherited from class com.google.common.truth.Subject
failureStrategy
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidcontainsEntry(Object key, Object value)Fails if the map does not contain the given entry.voidcontainsKey(Object key)Fails if the map does not contain the given key.voiddoesNotContainEntry(Object key, Object value)Fails if the map contains the given entry.voiddoesNotContainKey(Object key)Fails if the map contains the given key.MapSubject.WithValue<V>hasKey(K key)Deprecated.UsecontainsKey(Object)instead.voidhasSize(int expectedSize)Fails if the map does not have the given size.voidisEmpty()Fails if the map is not empty.voidisNotEmpty()Fails if the map is empty.voidlacksKey(K key)Deprecated.UsedoesNotContainKey(Object)instead.-
Methods inherited from class com.google.common.truth.Subject
check, equals, fail, fail, fail, failWithBadResults, failWithCustomSubject, failWithoutSubject, failWithRawMessage, getDisplaySubject, getSubject, hasField, hashCode, internalCustomName, is, isA, isEqualTo, isInstanceOf, isNotA, isNotEqualTo, isNotInstanceOf, isNotNull, isNotSameAs, isNull, isSameAs, labeled, named
-
-
-
-
Method Detail
-
isEmpty
public void isEmpty()
Fails if the map is not empty.
-
isNotEmpty
public void isNotEmpty()
Fails if the map is empty.
-
hasSize
public final void hasSize(int expectedSize)
Fails if the map does not have the given size.
-
containsKey
public void containsKey(Object key)
Fails if the map does not contain the given key.
-
doesNotContainKey
public void doesNotContainKey(Object key)
Fails if the map contains the given key.
-
containsEntry
public void containsEntry(Object key, Object value)
Fails if the map does not contain the given entry.
-
doesNotContainEntry
public void doesNotContainEntry(Object key, Object value)
Fails if the map contains the given entry.
-
hasKey
@Deprecated public MapSubject.WithValue<V> hasKey(K key)
Deprecated.UsecontainsKey(Object)instead.Fails if the map does not contain the given key.
-
lacksKey
@Deprecated public void lacksKey(K key)
Deprecated.UsedoesNotContainKey(Object)instead.Fails if the map contains the given key.
-
-