Package net.bytebuddy.matcher
Class ModifierMatcher<T extends ModifierReviewable>
- java.lang.Object
-
- net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase<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.AbstractBase<T>
An element matcher that matches a byte code element by its modifiers.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classModifierMatcher.ModeDetermines 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>
-
-
Field Summary
Fields Modifier and Type Field Description private ModifierMatcher.ModemodeThe 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 booleanmatches(T target)Matches a target against this element matcher.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.StringtoString()-
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.
-
matches
public boolean matches(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
-
-