org.hamcrest.collection
Class IsMapContaining<K,V>

java.lang.Object
  extended by org.hamcrest.BaseMatcher<T>
      extended by org.hamcrest.TypeSafeMatcher<java.util.Map<K,V>>
          extended by 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>>


Constructor Summary
IsMapContaining(Matcher<K> keyMatcher, Matcher<V> valueMatcher)
           
 
Method Summary
 void describeTo(Description description)
          Generates a description of the object.
static
<K,V> Matcher<java.util.Map<K,V>>
hasEntry(K key, V value)
           
static
<K,V> Matcher<java.util.Map<K,V>>
hasEntry(Matcher<K> keyMatcher, Matcher<V> valueMatcher)
           
static
<K,V> Matcher<java.util.Map<K,V>>
hasKey(K key)
           
static
<K,V> Matcher<java.util.Map<K,V>>
hasKey(Matcher<K> keyMatcher)
           
static
<K,V> Matcher<java.util.Map<K,V>>
hasValue(Matcher<V> valueMatcher)
           
static
<K,V> Matcher<java.util.Map<K,V>>
hasValue(V value)
           
 boolean matchesSafely(java.util.Map<K,V> map)
          Subclasses should implement this.
 
Methods inherited from class org.hamcrest.TypeSafeMatcher
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

IsMapContaining

public IsMapContaining(Matcher<K> keyMatcher,
                       Matcher<V> valueMatcher)
Method Detail

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)