Package net.bytebuddy.matcher
Class StringMatcher
- java.lang.Object
-
- net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase<W>
-
- net.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues<java.lang.String>
-
- net.bytebuddy.matcher.StringMatcher
-
- All Implemented Interfaces:
ElementMatcher<java.lang.String>,ElementMatcher.Junction<java.lang.String>
@Enhance public class StringMatcher extends ElementMatcher.Junction.ForNonNullValues<java.lang.String>
An element matcher that compares two strings by a given pattern which is characterized by aStringMatcher.Mode.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStringMatcher.ModeDefines the mode aStringMatchercompares to strings with.-
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 StringMatcher.ModemodeThe mode to apply for matching the given value against the matcher's input.private java.lang.StringvalueThe text value to match against.
-
Constructor Summary
Constructors Constructor Description StringMatcher(java.lang.String value, StringMatcher.Mode mode)Creates a new string matcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleandoMatch(java.lang.String target)Matches the supplied value if it was found not to benull.java.lang.StringtoString()-
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
-
value
private final java.lang.String value
The text value to match against.
-
mode
private final StringMatcher.Mode mode
The mode to apply for matching the given value against the matcher's input.
-
-
Constructor Detail
-
StringMatcher
public StringMatcher(java.lang.String value, StringMatcher.Mode mode)Creates a new string matcher.- Parameters:
value- The value that is the base of the matching.mode- The mode to apply for matching the given value against the matcher's input
-
-
Method Detail
-
doMatch
protected boolean doMatch(java.lang.String target)
Matches the supplied value if it was found not to benull.- Specified by:
doMatchin classElementMatcher.Junction.ForNonNullValues<java.lang.String>- 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
-
-