1f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot// Generated source. 2f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabotpackage org.hamcrest; 3f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 4f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabotpublic class Matchers { 5f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 6f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 7f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * Decorates another Matcher, retaining the behavior but allowing tests 8f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * to be slightly more expressive. 9f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * 10f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * eg. assertThat(cheese, equalTo(smelly)) 11f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * vs assertThat(cheese, is(equalTo(smelly))) 12f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 13f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> is(org.hamcrest.Matcher<T> matcher) { 14f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.core.Is.is(matcher); 15f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 16f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 17f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 18f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * This is a shortcut to the frequently used is(equalTo(x)). 19f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * 20f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * eg. assertThat(cheese, is(equalTo(smelly))) 21f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * vs assertThat(cheese, is(smelly)) 22f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 23f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> is(T value) { 24f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.core.Is.is(value); 25f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 26f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 27f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 28f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * This is a shortcut to the frequently used is(instanceOf(SomeClass.class)). 29f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * 30f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * eg. assertThat(cheese, is(instanceOf(Cheddar.class))) 31f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * vs assertThat(cheese, is(Cheddar.class)) 32f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 33f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static org.hamcrest.Matcher<java.lang.Object> is(java.lang.Class<?> type) { 34f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.core.Is.is(type); 35f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 36f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 37f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 38f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * Inverts the rule. 39f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 40f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> not(org.hamcrest.Matcher<T> matcher) { 41f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.core.IsNot.not(matcher); 42f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 43f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 44f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 45f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * This is a shortcut to the frequently used not(equalTo(x)). 46f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * 47f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * eg. assertThat(cheese, is(not(equalTo(smelly)))) 48f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * vs assertThat(cheese, is(not(smelly))) 49f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 50f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> not(T value) { 51f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.core.IsNot.not(value); 52f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 53f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 54f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 55f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * Is the value equal to another value, as tested by the 56f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * {@link java.lang.Object#equals} invokedMethod? 57f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 58f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> equalTo(T operand) { 59f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.core.IsEqual.equalTo(operand); 60f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 61f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 62f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 63f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * Is the value an instance of a particular type? 64f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 65f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static org.hamcrest.Matcher<java.lang.Object> instanceOf(java.lang.Class<?> type) { 66f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.core.IsInstanceOf.instanceOf(type); 67f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 68f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 69f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 70f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * Evaluates to true only if ALL of the passed in matchers evaluate to true. 71f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 72f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> allOf(org.hamcrest.Matcher<? extends T>... matchers) { 73f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.core.AllOf.allOf(matchers); 74f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 75f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 76f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 77f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * Evaluates to true only if ALL of the passed in matchers evaluate to true. 78f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 79f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> allOf(java.lang.Iterable<org.hamcrest.Matcher<? extends T>> matchers) { 80f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.core.AllOf.allOf(matchers); 81f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 82f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 83f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 84f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * Evaluates to true if ANY of the passed in matchers evaluate to true. 85f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 86f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> anyOf(org.hamcrest.Matcher<? extends T>... matchers) { 87f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.core.AnyOf.anyOf(matchers); 88f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 89f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 90f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 91f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * Evaluates to true if ANY of the passed in matchers evaluate to true. 92f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 93f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> anyOf(java.lang.Iterable<org.hamcrest.Matcher<? extends T>> matchers) { 94f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.core.AnyOf.anyOf(matchers); 95f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 96f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 97f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 98f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * Creates a new instance of IsSame 99f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * 100f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * @param object The predicate evaluates to true only when the argument is 101f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * this object. 102f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 103f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> sameInstance(T object) { 104f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.core.IsSame.sameInstance(object); 105f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 106f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 107f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 108f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * This matcher always evaluates to true. 109f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 110f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> anything() { 111f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.core.IsAnything.anything(); 112f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 113f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 114f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 115f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * This matcher always evaluates to true. 116f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * 117f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * @param description A meaningful string used when describing itself. 118f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 119f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> anything(java.lang.String description) { 120f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.core.IsAnything.anything(description); 121f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 122f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 123f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 124f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * This matcher always evaluates to true. With type inference. 125f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 126f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> any(java.lang.Class<T> type) { 127f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.core.IsAnything.any(type); 128f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 129f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 130f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 131f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * Matches if value is null. 132f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 133f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> nullValue() { 134f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.core.IsNull.nullValue(); 135f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 136f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 137f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 138f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * Matches if value is null. With type inference. 139f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 140f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> nullValue(java.lang.Class<T> type) { 141f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.core.IsNull.nullValue(type); 142f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 143f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 144f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 145f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * Matches if value is not null. 146f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 147f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> notNullValue() { 148f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.core.IsNull.notNullValue(); 149f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 150f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 151f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 152f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * Matches if value is not null. With type inference. 153f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 154f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> notNullValue(java.lang.Class<T> type) { 155f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.core.IsNull.notNullValue(type); 156f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 157f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 158f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 159f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * Wraps an existing matcher and overrides the description when it fails. 160f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 161f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> describedAs(java.lang.String description, org.hamcrest.Matcher<T> matcher, java.lang.Object... values) { 162f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.core.DescribedAs.describedAs(description, matcher, values); 163f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 164f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 165f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T[]> hasItemInArray(org.hamcrest.Matcher<T> elementMatcher) { 166f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.collection.IsArrayContaining.hasItemInArray(elementMatcher); 167f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 168f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 169f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T[]> hasItemInArray(T element) { 170f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.collection.IsArrayContaining.hasItemInArray(element); 171f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 172f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 173f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<java.lang.Iterable<T>> hasItem(T element) { 174f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.collection.IsCollectionContaining.hasItem(element); 175f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 176f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 177f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<java.lang.Iterable<T>> hasItem(org.hamcrest.Matcher<? extends T> elementMatcher) { 178f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.collection.IsCollectionContaining.hasItem(elementMatcher); 179f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 180f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 181f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<java.lang.Iterable<T>> hasItems(org.hamcrest.Matcher<? extends T>... elementMatchers) { 182f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.collection.IsCollectionContaining.hasItems(elementMatchers); 183f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 184f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 185f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<java.lang.Iterable<T>> hasItems(T... elements) { 186f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.collection.IsCollectionContaining.hasItems(elements); 187f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 188f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 189f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <K, V> org.hamcrest.Matcher<java.util.Map<K, V>> hasEntry(org.hamcrest.Matcher<K> keyMatcher, org.hamcrest.Matcher<V> valueMatcher) { 190f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.collection.IsMapContaining.hasEntry(keyMatcher, valueMatcher); 191f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 192f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 193f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <K, V> org.hamcrest.Matcher<java.util.Map<K, V>> hasEntry(K key, V value) { 194f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.collection.IsMapContaining.hasEntry(key, value); 195f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 196f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 197f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <K, V> org.hamcrest.Matcher<java.util.Map<K, V>> hasKey(org.hamcrest.Matcher<K> keyMatcher) { 198f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.collection.IsMapContaining.hasKey(keyMatcher); 199f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 200f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 201f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <K, V> org.hamcrest.Matcher<java.util.Map<K, V>> hasKey(K key) { 202f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.collection.IsMapContaining.hasKey(key); 203f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 204f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 205f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <K, V> org.hamcrest.Matcher<java.util.Map<K, V>> hasValue(org.hamcrest.Matcher<V> valueMatcher) { 206f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.collection.IsMapContaining.hasValue(valueMatcher); 207f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 208f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 209f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <K, V> org.hamcrest.Matcher<java.util.Map<K, V>> hasValue(V value) { 210f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.collection.IsMapContaining.hasValue(value); 211f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 212f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 213f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> isIn(java.util.Collection<T> collection) { 214f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.collection.IsIn.isIn(collection); 215f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 216f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 217f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> isIn(T[] param1) { 218f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.collection.IsIn.isIn(param1); 219f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 220f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 221f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> isOneOf(T... elements) { 222f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.collection.IsIn.isOneOf(elements); 223f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 224f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 225f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static org.hamcrest.Matcher<java.lang.Double> closeTo(double operand, double error) { 226f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.number.IsCloseTo.closeTo(operand, error); 227f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 228f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 229f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T extends java.lang.Comparable<T>> org.hamcrest.Matcher<T> greaterThan(T value) { 230f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.number.OrderingComparisons.greaterThan(value); 231f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 232f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 233f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T extends java.lang.Comparable<T>> org.hamcrest.Matcher<T> greaterThanOrEqualTo(T value) { 234f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.number.OrderingComparisons.greaterThanOrEqualTo(value); 235f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 236f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 237f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T extends java.lang.Comparable<T>> org.hamcrest.Matcher<T> lessThan(T value) { 238f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.number.OrderingComparisons.lessThan(value); 239f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 240f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 241f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T extends java.lang.Comparable<T>> org.hamcrest.Matcher<T> lessThanOrEqualTo(T value) { 242f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.number.OrderingComparisons.lessThanOrEqualTo(value); 243f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 244f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 245f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static org.hamcrest.Matcher<java.lang.String> equalToIgnoringCase(java.lang.String string) { 246f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.text.IsEqualIgnoringCase.equalToIgnoringCase(string); 247f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 248f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 249f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static org.hamcrest.Matcher<java.lang.String> equalToIgnoringWhiteSpace(java.lang.String string) { 250f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.text.IsEqualIgnoringWhiteSpace.equalToIgnoringWhiteSpace(string); 251f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 252f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 253f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static org.hamcrest.Matcher<java.lang.String> containsString(java.lang.String substring) { 254f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.text.StringContains.containsString(substring); 255f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 256f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 257f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static org.hamcrest.Matcher<java.lang.String> endsWith(java.lang.String substring) { 258f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.text.StringEndsWith.endsWith(substring); 259f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 260f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 261f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static org.hamcrest.Matcher<java.lang.String> startsWith(java.lang.String substring) { 262f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.text.StringStartsWith.startsWith(substring); 263f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 264f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 265f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> hasToString(org.hamcrest.Matcher<java.lang.String> toStringMatcher) { 266f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.object.HasToString.hasToString(toStringMatcher); 267f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 268f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 269f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<java.lang.Class<?>> typeCompatibleWith(java.lang.Class<T> baseType) { 270f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.object.IsCompatibleType.typeCompatibleWith(baseType); 271f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 272f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 273f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 274f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * Constructs an IsEventFrom Matcher that returns true for any object 275f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * derived from <var>eventClass</var> announced by <var>source</var>. 276f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 277f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static org.hamcrest.Matcher<java.util.EventObject> eventFrom(java.lang.Class<? extends java.util.EventObject> eventClass, java.lang.Object source) { 278f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.object.IsEventFrom.eventFrom(eventClass, source); 279f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 280f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 281f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /** 282f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * Constructs an IsEventFrom Matcher that returns true for any object 283f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * derived from {@link java.util.EventObject} announced by <var>source 284f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot * </var>. 285f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 286f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static org.hamcrest.Matcher<java.util.EventObject> eventFrom(java.lang.Object source) { 287f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.object.IsEventFrom.eventFrom(source); 288f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 289f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 290f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot /* android-changed REMOVE 291f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> hasProperty(java.lang.String propertyName) { 292f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.beans.HasProperty.hasProperty(propertyName); 293f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 294f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 295f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static <T> org.hamcrest.Matcher<T> hasProperty(java.lang.String propertyName, org.hamcrest.Matcher value) { 296f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.beans.HasPropertyWithValue.hasProperty(propertyName, value); 297f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 298f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot */ 299f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 300f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static org.hamcrest.Matcher<org.w3c.dom.Node> hasXPath(java.lang.String xPath, org.hamcrest.Matcher<java.lang.String> valueMatcher) { 301f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.xml.HasXPath.hasXPath(xPath, valueMatcher); 302f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 303f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 304f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot public static org.hamcrest.Matcher<org.w3c.dom.Node> hasXPath(java.lang.String xPath) { 305f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot return org.hamcrest.xml.HasXPath.hasXPath(xPath); 306f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot } 307f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot 308f5e9a2415ec42c425c2bb17db46f2a9649992d80Brett Chabot} 309