public class ExtraMatchers extends Object
| Constructor and Description |
|---|
ExtraMatchers() |
| Modifier and Type | Method and Description |
|---|---|
static <T> org.hamcrest.Matcher<Iterable<? super T>> |
ordered(List<T> itemMatchers)
|
static org.hamcrest.Matcher<String> |
regex(String pattern)
Deprecated.
use
Matchers.matchesRegex(String) instead |
public static <T> org.hamcrest.Matcher<Iterable<? super T>> ordered(List<T> itemMatchers)
Iterables that matches when consecutive passes over the
examined Iterable yield at least one item that is matched by the corresponding
matcher from the specified itemMatchers. Whilst matching, each traversal of
the examined Iterable will stop as soon as a matching item is found.
For example:
assertThat(Arrays.asList("foo","bar","baz"),hasItems(endsWith("z"),endsWith("o")))
T - the typeitemMatchers - the matchers to apply to items provided by the examined Iterable@Deprecated public static org.hamcrest.Matcher<String> regex(String pattern)
Matchers.matchesRegex(String) insteadString that matches against a regex pattern.
Returns success based on java.util.regex.Pattern.matcher(input).matches();
pattern - the Pattern syntax pattern to match against.Copyright © 1995–2025 Mort Bay Consulting. All rights reserved.