Package net.bytebuddy.matcher
Class ModifierMatcher<T extends ModifierReviewable>
java.lang.Object
net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase<W>
net.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues<T>
net.bytebuddy.matcher.ModifierMatcher<T>
- Type Parameters:
T
- The type of the matched entity.
- All Implemented Interfaces:
ElementMatcher<T>
,ElementMatcher.Junction<T>
@Enhance
public class ModifierMatcher<T extends ModifierReviewable>
extends ElementMatcher.Junction.ForNonNullValues<T>
An element matcher that matches a byte code element by its modifiers.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Determines the type of modifier to be matched by aModifierMatcher
.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 ModifierMatcher.Mode
The matching mode to apply by this modifier matcher. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new element matcher that matches an element by its modifier. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Matches the supplied value if it was found not to benull
.static <T extends ModifierReviewable>
ElementMatcher.Junction<T>of
(ModifierMatcher.Mode mode) Returns a new element matcher that matches an element by its modifier.toString()
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
-
mode
The matching mode to apply by this modifier matcher.
-
-
Constructor Details
-
ModifierMatcher
Creates a new element matcher that matches an element by its modifier.- Parameters:
mode
- The match mode to apply to the matched element's modifier.
-
-
Method Details
-
of
public static <T extends ModifierReviewable> ElementMatcher.Junction<T> of(ModifierMatcher.Mode mode) Returns a new element matcher that matches an element by its modifier.- Type Parameters:
T
- The type of the matched entity.- Parameters:
mode
- The match mode to apply to the matched element's modifier.- Returns:
- A matcher that matches methods of the provided sort.
-
doMatch
Matches the supplied value if it was found not to benull
.- Specified by:
doMatch
in classElementMatcher.Junction.ForNonNullValues<T extends ModifierReviewable>
- Parameters:
target
- The instance to be matched.- Returns:
true
if the given element is matched by this matcher orfalse
otherwise.
-
toString
-