Package net.bytebuddy.matcher
Class StringMatcher
- java.lang.Object
-
- net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase<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.AbstractBase<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 class
StringMatcher.Mode
Defines the mode aStringMatcher
compares 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>
-
-
Field Summary
Fields Modifier and Type Field Description private StringMatcher.Mode
mode
The mode to apply for matching the given value against the matcher's input.private java.lang.String
value
The 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 boolean
matches(java.lang.String target)
Matches a target against this element matcher.java.lang.String
toString()
-
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
-
matches
public boolean matches(java.lang.String target)
Matches a target against this element matcher.- 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
-
-