Package net.bytebuddy.matcher
Class CollectionElementMatcher<T>
java.lang.Object
net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase<Iterable<? extends T>>
net.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues<Iterable<? extends T>>
net.bytebuddy.matcher.CollectionElementMatcher<T>
- Type Parameters:
T- The type of the elements contained by the collection.
- All Implemented Interfaces:
ElementMatcher<Iterable<? extends T>>,ElementMatcher.Junction<Iterable<? extends T>>
@Enhance
public class CollectionElementMatcher<T>
extends ElementMatcher.Junction.ForNonNullValues<Iterable<? extends T>>
A matcher that matches a given element of a collection. If no such element is contained by the matched iterable, the matcher
returns
false.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.matcher.ElementMatcher
ElementMatcher.Junction<S>Nested classes/interfaces inherited from interface net.bytebuddy.matcher.ElementMatcher.Junction
ElementMatcher.Junction.AbstractBase<V>, ElementMatcher.Junction.Conjunction<W>, ElementMatcher.Junction.Disjunction<W>, ElementMatcher.Junction.ForNonNullValues<W> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe index of the matched element.private final ElementMatcher<? super T> The matcher for the given element, if it exists. -
Constructor Summary
ConstructorsConstructorDescriptionCollectionElementMatcher(int index, ElementMatcher<? super T> matcher) Creates a new matcher for an element in a collection. -
Method Summary
Methods inherited from class net.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues
matchesMethods inherited from class net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase
and, or
-
Field Details
-
index
private final int indexThe index of the matched element. -
matcher
The matcher for the given element, if it exists.
-
-
Constructor Details
-
CollectionElementMatcher
Creates a new matcher for an element in a collection.- Parameters:
index- The index of the matched element.matcher- The matcher for the given element, if it exists.
-
-
Method Details
-
doMatch
Matches the supplied value if it was found not to benull.- Specified by:
doMatchin classElementMatcher.Junction.ForNonNullValues<Iterable<? extends T>>- Parameters:
target- The instance to be matched.- Returns:
trueif the given element is matched by this matcher orfalseotherwise.
-
toString
-