T
- The type of the elements contained by the collection.@HashCodeAndEqualsPlugin.Enhance public class CollectionElementMatcher<T> extends ElementMatcher.Junction.AbstractBase<java.lang.Iterable<? extends T>>
false
.ElementMatcher.Junction.AbstractBase<V>, ElementMatcher.Junction.Conjunction<W>, ElementMatcher.Junction.Disjunction<W>
ElementMatcher.Junction<S>
Modifier and Type | Field and Description |
---|---|
private int |
index
The index of the matched element.
|
private ElementMatcher<? super T> |
matcher
The matcher for the given element, if it exists.
|
Constructor and Description |
---|
CollectionElementMatcher(int index,
ElementMatcher<? super T> matcher)
Creates a new matcher for an element in a collection.
|
Modifier and Type | Method and Description |
---|---|
boolean |
matches(java.lang.Iterable<? extends T> target)
Matches a target against this element matcher.
|
java.lang.String |
toString() |
and, or
private final int index
private final ElementMatcher<? super T> matcher
public CollectionElementMatcher(int index, ElementMatcher<? super T> matcher)
index
- The index of the matched element.matcher
- The matcher for the given element, if it exists.public boolean matches(java.lang.Iterable<? extends T> target)
target
- The instance to be matched.true
if the given element is matched by this matcher or false
otherwise.public java.lang.String toString()
toString
in class java.lang.Object