public class ListWithAnyOfMatcher<T> extends ListMatcher<T>
matchers
match against at least one item in a given List.Constructor and Description |
---|
ListWithAnyOfMatcher(org.hamcrest.Matcher<T>... matchers)
Construct a matcher that will return true if any of the given
matchers matches against at least one
item in a given List. |
Modifier and Type | Method and Description |
---|---|
protected void |
describeCollectionType(org.hamcrest.Description description)
Describes the type of collection expected.
|
protected String |
failedMatcherMessage()
The message to append behind a failing matcher.
|
protected String |
getLastSeparator()
The separator to use between the two last events.
|
boolean |
matchesList(List<T> items)
Evaluates the matcher for argument
item . |
describeTo, getMatchers, matches, matchRemainder, reportFailed
@SafeVarargs public ListWithAnyOfMatcher(org.hamcrest.Matcher<T>... matchers)
matchers
matches against at least one
item in a given List.matchers
- The matchers that must match against at least one item in the list.public boolean matchesList(List<T> items)
ListMatcher
item
. The item has been verified to be a list, but the exact
type of contents of a list cannot be verified, due to Erasure of Generic Types.matchesList
in class ListMatcher<T>
items
- the object against which the matcher is evaluated.true
if item
matches, otherwise false
.BaseMatcher
protected void describeCollectionType(org.hamcrest.Description description)
ListMatcher
describeCollectionType
in class ListMatcher<T>
description
- the description to append the collection type toprotected String failedMatcherMessage()
ListMatcher
failedMatcherMessage
in class ListMatcher<T>
protected String getLastSeparator()
ListMatcher
getLastSeparator
in class ListMatcher<T>
Copyright © 2010–2017. All rights reserved.