Class NameMatcher<T extends NamedElement>
java.lang.Object
net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase<T>
net.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues<T>
net.bytebuddy.matcher.NameMatcher<T>
- Type Parameters:
T- The type of the matched entity.
- All Implemented Interfaces:
ElementMatcher<T>, ElementMatcher.Junction<T>
@Enhance
public class NameMatcher<T extends NamedElement>
extends ElementMatcher.Junction.ForNonNullValues<T>
A method matcher that matches a byte code element's source code name:
- The source code name of types is equal to their binary name where arrays are appended a
[]by their arity and where inner classes are appended by dollar signs to their outer class's source name. - Constructors and the type initializer methods are represented by the empty string as they do not represent a source code name.
- Fields are named as in the source code.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ElementMatcher
ElementMatcher.Junction<S>Nested classes/interfaces inherited from interface ElementMatcher.Junction
ElementMatcher.Junction.AbstractBase<V>, ElementMatcher.Junction.Conjunction<W>, ElementMatcher.Junction.Disjunction<W>, ElementMatcher.Junction.ForNonNullValues<W> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ElementMatcher<String> The matcher that is applied to a byte code element's source code name. -
Constructor Summary
ConstructorsConstructorDescriptionNameMatcher(ElementMatcher<String> matcher) Creates a new matcher for a byte code element's source name. -
Method Summary
Methods inherited from class ElementMatcher.Junction.ForNonNullValues
matchesMethods inherited from class ElementMatcher.Junction.AbstractBase
and, or
-
Field Details
-
matcher
The matcher that is applied to a byte code element's source code name.
-
-
Constructor Details
-
NameMatcher
Creates a new matcher for a byte code element's source name.- Parameters:
matcher- The matcher that is applied to a byte code element's source code name.
-
-
Method Details
-
doMatch
Matches the supplied value if it was found not to benull.- Specified by:
doMatchin classElementMatcher.Junction.ForNonNullValues<T extends NamedElement>- Parameters:
target- The instance to be matched.- Returns:
trueif the given element is matched by this matcher orfalseotherwise.
-
toString
-