Refine search
/** * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers. * <p/> * For example: * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre> */ @Factory public static <T> Matcher<T> allOf(Matcher<? super T>... matchers) { return allOf(Arrays.asList(matchers)); }
/** * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers. * <p/> * For example: * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre> */ @Factory public static <T> Matcher<T> allOf(Iterable<Matcher<? super T>> matchers) { return new AllOf<T>(matchers); }
/** * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers. * <p/> * For example: * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre> */ public static <T> org.hamcrest.Matcher<T> allOf(java.lang.Iterable<org.hamcrest.Matcher<? super T>> matchers) { return org.hamcrest.core.AllOf.<T>allOf(matchers); }
/** * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers. * For example: * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre> */ public static <T> Matcher<T> allOf(Iterable<Matcher<? super T>> matchers) { return new AllOf<>(matchers); }
/** * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers. * <p/> * For example: * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre> */ public static <T> org.hamcrest.Matcher<T> allOf(org.hamcrest.Matcher<? super T> first, org.hamcrest.Matcher<? super T> second, org.hamcrest.Matcher<? super T> third) { return org.hamcrest.core.AllOf.<T>allOf(first, second, third); }
public CombinableMatcher<T> and(Matcher<? super T> other) { return new CombinableMatcher<T>(new AllOf<T>(templatedListWith(other))); }
/** * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers. * <p/> * For example: * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre> */ @Factory public static <T> Matcher<T> allOf(Matcher<? super T>... matchers) { return allOf(Arrays.asList(matchers)); }
/** * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers. * <p/> * For example: * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre> */ public static <T> org.hamcrest.Matcher<T> allOf(org.hamcrest.Matcher<? super T> first, org.hamcrest.Matcher<? super T> second, org.hamcrest.Matcher<? super T> third, org.hamcrest.Matcher<? super T> fourth) { return org.hamcrest.core.AllOf.<T>allOf(first, second, third, fourth); }
/** * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers. * <p/> * For example: * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre> */ @Factory public static <T> Matcher<T> allOf(Iterable<Matcher<? super T>> matchers) { return new AllOf<T>(matchers); }
public CombinableMatcher<T> and(Matcher<? super T> other) { return new CombinableMatcher<T>(new AllOf<T>(templatedListWith(other))); }
/** * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers. * <p/> * For example: * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre> */ @Factory public static <T> Matcher<T> allOf(Matcher<? super T> first, Matcher<? super T> second) { List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>(2); matchers.add(first); matchers.add(second); return allOf(matchers); }
/** * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers. * <p/> * For example: * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre> */ public static <T> org.hamcrest.Matcher<T> allOf(org.hamcrest.Matcher<? super T> first, org.hamcrest.Matcher<? super T> second, org.hamcrest.Matcher<? super T> third, org.hamcrest.Matcher<? super T> fourth, org.hamcrest.Matcher<? super T> fifth, org.hamcrest.Matcher<? super T> sixth) { return org.hamcrest.core.AllOf.<T>allOf(first, second, third, fourth, fifth, sixth); }
/** * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers. * <p/> * For example: * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre> */ @Factory public static <T> Matcher<T> allOf(Iterable<Matcher<? super T>> matchers) { return new AllOf<T>(matchers); }
public CombinableMatcher<T> and(Matcher<? super T> other) { return new CombinableMatcher<>(new AllOf<>(templatedListWith(other))); }
/** * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers. * <p/> * For example: * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre> */ @Factory public static <T> Matcher<T> allOf(Matcher<? super T> first, Matcher<? super T> second) { List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>(2); matchers.add(first); matchers.add(second); return allOf(matchers); }
/** * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers. * <p/> * For example: * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre> */ public static <T> org.hamcrest.Matcher<T> allOf(org.hamcrest.Matcher<? super T> first, org.hamcrest.Matcher<? super T> second) { return org.hamcrest.core.AllOf.<T>allOf(first, second); }
@Factory @SuppressWarnings({ "unchecked", "rawtypes" }) public static <T, V> Matcher<Map<? super T, ? super V>> hasAllEntries(Map<T, V> entries) { List<Matcher<Map<? super T, ? super V>>> matchers = new ArrayList<>(entries.size()); for (Map.Entry<T, V> entry : entries.entrySet()) { final V value = entry.getValue(); if (value instanceof Matcher<?>) { matchers.add(hasEntry(entry.getKey(), (Matcher<V>) value)); } else { matchers.add(hasEntry(entry.getKey(), value)); } } //return AllOf.allOf(matchers); //Does not work with Hamcrest 1.3 return new AllOf(matchers); }
/** * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers. * For example: * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre> */ public static <T> Matcher<T> allOf(Iterable<Matcher<? super T>> matchers) { return new AllOf<>(matchers); }
/** * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers. * <p/> * For example: * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre> */ @Factory public static <T> Matcher<T> allOf(Matcher<? super T> first, Matcher<? super T> second, Matcher<? super T> third) { List<Matcher<? super T>> matchers = new ArrayList<Matcher<? super T>>(3); matchers.add(first); matchers.add(second); matchers.add(third); return allOf(matchers); }
/** * Creates a matcher that matches if the examined object matches <b>ALL</b> of the specified matchers. * <p/> * For example: * <pre>assertThat("myValue", allOf(startsWith("my"), containsString("Val")))</pre> */ public static <T> org.hamcrest.Matcher<T> allOf(org.hamcrest.Matcher<? super T>... matchers) { return org.hamcrest.core.AllOf.<T>allOf(matchers); }