org.hamcrest.collection
Class IsMapContaining<K,V>
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeMatcher<java.util.Map<K,V>>
org.hamcrest.collection.IsMapContaining<K,V>
- All Implemented Interfaces:
- Matcher<java.util.Map<K,V>>, SelfDescribing
public class IsMapContaining<K,V>
- extends TypeSafeMatcher<java.util.Map<K,V>>
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
IsMapContaining
public IsMapContaining(Matcher<K> keyMatcher,
Matcher<V> valueMatcher)
matchesSafely
public boolean matchesSafely(java.util.Map<K,V> map)
- Description copied from class:
TypeSafeMatcher
- Subclasses should implement this. The item will already have been checked for
the specific type and will never be null.
- Specified by:
matchesSafely
in class TypeSafeMatcher<java.util.Map<K,V>>
describeTo
public void describeTo(Description description)
- Description copied from interface:
SelfDescribing
- Generates a description of the object. The description may be part of a
a description of a larger object of which this is just a component, so it
should be worded appropriately.
- Parameters:
description
- The description to be built or appended to.
hasEntry
public static <K,V> Matcher<java.util.Map<K,V>> hasEntry(Matcher<K> keyMatcher,
Matcher<V> valueMatcher)
hasEntry
public static <K,V> Matcher<java.util.Map<K,V>> hasEntry(K key,
V value)
hasKey
public static <K,V> Matcher<java.util.Map<K,V>> hasKey(Matcher<K> keyMatcher)
hasKey
public static <K,V> Matcher<java.util.Map<K,V>> hasKey(K key)
hasValue
public static <K,V> Matcher<java.util.Map<K,V>> hasValue(Matcher<V> valueMatcher)
hasValue
public static <K,V> Matcher<java.util.Map<K,V>> hasValue(V value)