org.hamcrest.collection
public class IsMapContaining<K,V> extends TypeSafeMatcher<Map<K,V>>
| Constructor and Description |
|---|
IsMapContaining(Matcher<K> keyMatcher,
Matcher<V> valueMatcher) |
| Modifier and Type | Method and Description |
|---|---|
void |
describeTo(Description description)
Generates a description of the object.
|
static <K,V> Matcher<Map<K,V>> |
hasEntry(K key,
V value) |
static <K,V> Matcher<Map<K,V>> |
hasEntry(Matcher<K> keyMatcher,
Matcher<V> valueMatcher) |
static <K,V> Matcher<Map<K,V>> |
hasKey(K key) |
static <K,V> Matcher<Map<K,V>> |
hasKey(Matcher<K> keyMatcher) |
static <K,V> Matcher<Map<K,V>> |
hasValue(Matcher<V> valueMatcher) |
static <K,V> Matcher<Map<K,V>> |
hasValue(V value) |
boolean |
matchesSafely(Map<K,V> map)
Subclasses should implement this.
|
matches_dont_implement_Matcher___instead_extend_BaseMatcher_, toStringpublic boolean matchesSafely(Map<K,V> map)
TypeSafeMatchermatchesSafely in class TypeSafeMatcher<Map<K,V>>public void describeTo(Description description)
SelfDescribingdescription - The description to be built or appended to.public static <K,V> Matcher<Map<K,V>> hasEntry(Matcher<K> keyMatcher, Matcher<V> valueMatcher)