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 Classes Modifier and Type Class Description static class
ModifierMatcher.Mode
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
Fields Modifier and Type Field Description private ModifierMatcher.Mode
mode
The matching mode to apply by this modifier matcher.
-
Constructor Summary
Constructors Constructor Description ModifierMatcher(ModifierMatcher.Mode mode)
Creates a new element matcher that matches an element by its modifier.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
doMatch(T target)
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.java.lang.String
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 Detail
-
mode
private final ModifierMatcher.Mode mode
The matching mode to apply by this modifier matcher.
-
-
Constructor Detail
-
ModifierMatcher
public ModifierMatcher(ModifierMatcher.Mode mode)
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 Detail
-
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
protected boolean doMatch(T target)
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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-