Skip to content

Commit ec5a0d8

Browse files
committed
Revert "Map entry matchers"
1 parent 558b6a6 commit ec5a0d8

File tree

5 files changed

+2
-335
lines changed

5 files changed

+2
-335
lines changed

hamcrest-library/src/main/java/org/hamcrest/Matchers.java

Lines changed: 2 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.hamcrest;
22

3+
import org.hamcrest.collection.IsCollectionContaining;
4+
35
import java.util.Collection;
46
import java.util.List;
57

@@ -1066,89 +1068,6 @@ public static <K, V> org.hamcrest.Matcher<java.util.Map<? extends K,? extends V>
10661068
return org.hamcrest.collection.IsMapContaining.<K,V>hasEntry(key, value);
10671069
}
10681070

1069-
/**
1070-
* Creates a matcher for {@link java.util.Map}s matching when the examined {@link java.util.Map}'s set of entries
1071-
* satisfies the specified <code>entriesMatcher</code>.
1072-
* For example:
1073-
* <pre>assertThat(myMap, hasEntries(hasSize(2)))</pre>
1074-
*
1075-
* @param entriesMatcher
1076-
* the matcher that must be satisfied by the set of entries
1077-
*/
1078-
public static <K, V> org.hamcrest.Matcher<java.util.Map<? extends K,? extends V>> hasEntries(Matcher<? super java.util.Set<? extends java.util.Map.Entry<? extends K, ? extends V>>> entriesMatcher) {
1079-
return org.hamcrest.collection.IsMapWithEntries.hasEntries(entriesMatcher);
1080-
}
1081-
1082-
/**
1083-
* Creates a matcher for {@link java.util.Map}s matching when the examined {@link java.util.Map}'s set of entries
1084-
* contains, in any order, entries satisfying the specified <code>entriesMatchers</code>.
1085-
* For example:
1086-
* <pre>assertThat(myMap, hasEntries(entry("a key"), entry("another key")))</pre>
1087-
*
1088-
* @param entriesMatchers
1089-
* the matchers that must be satisfied by the entries
1090-
*/
1091-
@SafeVarargs
1092-
public static <K, V> Matcher<java.util.Map<? extends K, ? extends V>> hasEntries(Matcher<? super java.util.Map.Entry<? extends K, ? extends V>>... entriesMatchers) {
1093-
return org.hamcrest.collection.IsMapWithEntries.hasEntries(entriesMatchers);
1094-
}
1095-
1096-
/**
1097-
* Creates a matcher for {@link java.util.Map.Entry}s matching when the examined {@link java.util.Map.Entry} has a key which satisfies
1098-
* the specified <code>keyMatcher</code>, and a value which satisfies the specified <code>valueMatcher</code>.
1099-
* For example:
1100-
* <pre>assertThat(myMap.keySet(), hasItem(entry(equalTo("key"), notNullValue())))</pre>
1101-
*
1102-
* @param keyMatcher
1103-
* the matcher that must be satisfied by the key
1104-
* @param valueMatcher
1105-
* the matcher that must be satisfied by the value
1106-
*/
1107-
public static <K, V> Matcher<? super java.util.Map.Entry<? extends K, ? extends V>> entry(Matcher<? super K> keyMatcher, Matcher<? super V> valueMatcher) {
1108-
return org.hamcrest.collection.IsMapEntry.entry(keyMatcher, valueMatcher);
1109-
}
1110-
1111-
/**
1112-
* Creates a matcher for {@link java.util.Map.Entry}s matching when the examined {@link java.util.Map.Entry} has a key which satisfies
1113-
* the specified <code>keyMatcher</code>; the value is ignored.
1114-
* For example:
1115-
* <pre>assertThat(myMap.keySet(), hasItem(entry(equalTo("key"))))</pre>
1116-
*
1117-
* @param keyMatcher
1118-
* the matcher that must be satisfied by the key
1119-
*/
1120-
public static <K> Matcher<? super java.util.Map.Entry<? extends K, ?>> entry(Matcher<? super K> keyMatcher) {
1121-
return org.hamcrest.collection.IsMapEntry.entry(keyMatcher);
1122-
}
1123-
1124-
/**
1125-
* Creates a matcher for {@link java.util.Map.Entry}s matching when the examined {@link java.util.Map.Entry} has the specified
1126-
* <code>key</code>, and a value which satisfies the specified <code>valueMatcher</code>.
1127-
* For example:
1128-
* <pre>assertThat(myMap.keySet(), hasItem(entry("key", notNullValue())))</pre>
1129-
*
1130-
* @param key
1131-
* the required key
1132-
* @param valueMatcher
1133-
* the matcher that must be satisfied by the value
1134-
*/
1135-
public static <K, V> Matcher<? super java.util.Map.Entry<? extends K, ? extends V>> entry(K key, Matcher<? super V> valueMatcher) {
1136-
return org.hamcrest.collection.IsMapEntry.entry(key, valueMatcher);
1137-
}
1138-
1139-
/**
1140-
* Creates a matcher for {@link java.util.Map.Entry}s matching when the examined {@link java.util.Map.Entry} has the specified
1141-
* <code>key</code>; the value is ignored.
1142-
* For example:
1143-
* <pre>assertThat(myMap.keySet(), hasItem(entry("key")))</pre>
1144-
*
1145-
* @param key
1146-
* the required key
1147-
*/
1148-
public static <K> Matcher<? super java.util.Map.Entry<? extends K, ?>> entry(K key) {
1149-
return org.hamcrest.collection.IsMapEntry.entry(key);
1150-
}
1151-
11521071
/**
11531072
* Creates a matcher for {@link java.util.Map}s matching when the examined {@link java.util.Map} contains
11541073
* at least one key that satisfies the specified matcher.

hamcrest-library/src/main/java/org/hamcrest/collection/IsMapEntry.java

Lines changed: 0 additions & 98 deletions
This file was deleted.

hamcrest-library/src/main/java/org/hamcrest/collection/IsMapWithEntries.java

Lines changed: 0 additions & 47 deletions
This file was deleted.

hamcrest-library/src/test/java/org/hamcrest/collection/IsMapEntryTest.java

Lines changed: 0 additions & 61 deletions
This file was deleted.

hamcrest-library/src/test/java/org/hamcrest/collection/IsMapWithEntriesTest.java

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)