Package net.bytebuddy.matcher
Class CollectionOneToOneMatcher<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.CollectionOneToOneMatcher<T>
- Type Parameters:
T
- The type of the matched entity.
- All Implemented Interfaces:
ElementMatcher<Iterable<? extends T>>
,ElementMatcher.Junction<Iterable<? extends T>>
@Enhance
public class CollectionOneToOneMatcher<T>
extends ElementMatcher.Junction.ForNonNullValues<Iterable<? extends T>>
An element matcher that matches a given iterable collection to a list of matchers on a per-element basis. For a
successful match, any element of the matched iterable collection must be successfully matched by a next
matcher of the supplied list of element matchers. For this to be possible, the matched iterable collection
and the supplied list of element matchers contain the same number of elements.
-
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 List
<? extends ElementMatcher<? super T>> The list of element matchers to match any elements of the matched iterable collection against. -
Constructor Summary
ConstructorsConstructorDescriptionCollectionOneToOneMatcher
(List<? extends ElementMatcher<? super T>> matchers) Creates a new matcher that compares a matched iterable collection against a list of element matchers. -
Method Summary
Methods inherited from class net.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues
matches
Methods inherited from class net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase
and, or
-
Field Details
-
matchers
The list of element matchers to match any elements of the matched iterable collection against.
-
-
Constructor Details
-
CollectionOneToOneMatcher
Creates a new matcher that compares a matched iterable collection against a list of element matchers.- Parameters:
matchers
- The list of element matchers to match any elements of the matched iterable collection against.
-
-
Method Details
-
doMatch
Matches the supplied value if it was found not to benull
.- Specified by:
doMatch
in classElementMatcher.Junction.ForNonNullValues<Iterable<? extends T>>
- Parameters:
target
- The instance to be matched.- Returns:
true
if the given element is matched by this matcher orfalse
otherwise.
-
toString
-