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 ClassesNested classes/interfaces inherited from class Subject
Subject.HasField -
Field Summary
Fields inherited from class Subject
failureStrategy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontainsEntry(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.(package private) static <K, V, M extends Map<K,V>>
MapSubject<? extends MapSubject<?, K, V, M>, K, V, M> create(FailureStrategy failureStrategy, Map<K, V> map) voiddoesNotContainEntry(Object key, Object value) Fails if the map contains the given entry.voiddoesNotContainKey(Object key) Fails if the map contains the given key.Deprecated.UsecontainsKey(Object)instead.final voidhasSize(int expectedSize) Fails if the map does not have the given size.voidisEmpty()Fails if the map is not empty.voidFails if the map is empty.voidDeprecated.UsedoesNotContainKey(Object)instead.Methods inherited from class 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
-
Constructor Details
-
MapSubject
-
-
Method Details
-
create
static <K, V, M extends Map<K,V>> MapSubject<? extends MapSubject<?,K, createV, M>, K, V, M> (FailureStrategy failureStrategy, Map<K, V> map) -
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
Fails if the map does not contain the given key. -
doesNotContainKey
Fails if the map contains the given key. -
containsEntry
-
doesNotContainEntry
-
hasKey
Deprecated.UsecontainsKey(Object)instead.Fails if the map does not contain the given key. -
lacksKey
Deprecated.UsedoesNotContainKey(Object)instead.Fails if the map contains the given key.
-
containsEntry(Object, Object)instead.