org.hamcrest.collection
Class IsMapContainingKey<K>

java.lang.Object
  extended by org.hamcrest.BaseMatcher<T>
      extended by org.hamcrest.TypeSafeMatcher<java.util.Map<? super K,?>>
          extended by org.hamcrest.collection.IsMapContainingKey<K>
All Implemented Interfaces:
org.hamcrest.Matcher<java.util.Map<? super K,?>>, org.hamcrest.SelfDescribing

public class IsMapContainingKey<K>
extends org.hamcrest.TypeSafeMatcher<java.util.Map<? super K,?>>


Constructor Summary
IsMapContainingKey(org.hamcrest.Matcher<? super K> keyMatcher)
           
 
Method Summary
 void describeMismatchSafely(java.util.Map<? super K,?> map, org.hamcrest.Description mismatchDescription)
           
 void describeTo(org.hamcrest.Description description)
           
static
<K> org.hamcrest.Matcher<java.util.Map<? super K,?>>
hasKey(K key)
           
static
<K> org.hamcrest.Matcher<java.util.Map<? super K,?>>
hasKey(org.hamcrest.Matcher<? super K> keyMatcher)
           
 boolean matchesSafely(java.util.Map<? super K,?> item)
           
 
Methods inherited from class org.hamcrest.TypeSafeMatcher
describeMismatch, matches
 
Methods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IsMapContainingKey

public IsMapContainingKey(org.hamcrest.Matcher<? super K> keyMatcher)
Method Detail

matchesSafely

public boolean matchesSafely(java.util.Map<? super K,?> item)
Specified by:
matchesSafely in class org.hamcrest.TypeSafeMatcher<java.util.Map<? super K,?>>

describeMismatchSafely

public void describeMismatchSafely(java.util.Map<? super K,?> map,
                                   org.hamcrest.Description mismatchDescription)
Overrides:
describeMismatchSafely in class org.hamcrest.TypeSafeMatcher<java.util.Map<? super K,?>>

describeTo

public void describeTo(org.hamcrest.Description description)

hasKey

public static <K> org.hamcrest.Matcher<java.util.Map<? super K,?>> hasKey(K key)

hasKey

public static <K> org.hamcrest.Matcher<java.util.Map<? super K,?>> hasKey(org.hamcrest.Matcher<? super K> keyMatcher)


Copyright © 2010. All Rights Reserved.