Top Description Fields Constructors Methods
net.bytebuddy.matcher

public Class CollectionElementMatcher<T>

extends ElementMatcher.Junction.ForNonNullValues<Iterable<? extends T>>
Class Inheritance
Annotations
@Enhance
Type Parameters
<T>
The type of the elements contained by the collection.
Imports
net.bytebuddy.build.HashCodeAndEqualsPlugin, java.util.Iterator

A matcher that matches a given element of a collection. If no such element is contained by the matched iterable, the matcher returns false.

Field Summary

Modifier and TypeField and Description
private final int
index

The index of the matched element.

private final ElementMatcher<? super T>
matcher

The matcher for the given element, if it exists.

Constructor Summary

AccessConstructor and Description
public
CollectionElementMatcher(int
The index of the matched element.
index
,
ElementMatcher<? super T>
The matcher for the given element, if it exists.
matcher
)

Creates a new matcher for an element in a collection.

Method Summary

Modifier and TypeMethod and Description
protected boolean
doMatch(Iterable<? extends T>
The instance to be matched.
target
)

Implements abstract net.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues.doMatch.

Matches the supplied value if it was found not to be null.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from net.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues:
matches

Field Detail

indexback to summary
private final int index

The index of the matched element.

matcherback to summary
private final ElementMatcher<? super T> matcher

The matcher for the given element, if it exists.

Constructor Detail

CollectionElementMatcherback to summary
public CollectionElementMatcher(int index, ElementMatcher<? super T> matcher)

Creates a new matcher for an element in a collection.

Parameters
index:int

The index of the matched element.

matcher:ElementMatcher<? super T>

The matcher for the given element, if it exists.

Method Detail

doMatchback to summary
protected boolean doMatch(Iterable<? extends T> target)

Implements abstract net.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues.doMatch.

Doc from net.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues.doMatch.

Matches the supplied value if it was found not to be null.

Parameters
target:Iterable<? extends T>

The instance to be matched.

Returns:boolean

true if the given element is matched by this matcher or false otherwise.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override