org.hamcrest.collection
Class IsMapContainingKey<K>
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeMatcher<java.util.Map<? super K,?>>
org.hamcrest.collection.IsMapContainingKey<K>
- All Implemented Interfaces:
- Matcher<java.util.Map<? super K,?>>, SelfDescribing
public class IsMapContainingKey<K>
- extends TypeSafeMatcher<java.util.Map<? super K,?>>
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
IsMapContainingKey
public IsMapContainingKey(Matcher<? super K> keyMatcher)
matchesSafely
public boolean matchesSafely(java.util.Map<? super K,?> item)
- 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<? super K,?>>
describeMismatchSafely
public void describeMismatchSafely(java.util.Map<? super K,?> map,
Description mismatchDescription)
- Description copied from class:
TypeSafeMatcher
- Subclasses should override this. The item will already have been checked for
the specific type and will never be null.
- Overrides:
describeMismatchSafely
in class TypeSafeMatcher<java.util.Map<? super K,?>>
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.
hasKey
public static <K> Matcher<java.util.Map<? super K,?>> hasKey(K key)
hasKey
public static <K> Matcher<java.util.Map<? super K,?>> hasKey(Matcher<? super K> keyMatcher)