Package net.bytebuddy.matcher
Class CollectionOneToOneMatcher<T>
- java.lang.Object
-
- net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase<java.lang.Iterable<? extends T>>
-
- net.bytebuddy.matcher.CollectionOneToOneMatcher<T>
-
- Type Parameters:
T- The type of the matched entity.
- All Implemented Interfaces:
ElementMatcher<java.lang.Iterable<? extends T>>,ElementMatcher.Junction<java.lang.Iterable<? extends T>>
@Enhance public class CollectionOneToOneMatcher<T> extends ElementMatcher.Junction.AbstractBase<java.lang.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>
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<? extends ElementMatcher<? super T>>matchersThe list of element matchers to match any elements of the matched iterable collection against.
-
Constructor Summary
Constructors Constructor Description CollectionOneToOneMatcher(java.util.List<? extends ElementMatcher<? super T>> matchers)Creates a new matcher that compares a matched iterable collection against a list of element matchers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanmatches(java.lang.Iterable<? extends T> target)Matches a target against this element matcher.java.lang.StringtoString()-
Methods inherited from class net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase
and, or
-
-
-
-
Field Detail
-
matchers
private final java.util.List<? extends ElementMatcher<? super T>> matchers
The list of element matchers to match any elements of the matched iterable collection against.
-
-
Constructor Detail
-
CollectionOneToOneMatcher
public CollectionOneToOneMatcher(java.util.List<? extends ElementMatcher<? super T>> matchers)
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 Detail
-
matches
public boolean matches(java.lang.Iterable<? extends T> target)
Matches a target against this element matcher.- Parameters:
target- The instance to be matched.- Returns:
trueif the given element is matched by this matcher orfalseotherwise.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-