Package net.bytebuddy.matcher
Enum StringMatcher.Mode
- All Implemented Interfaces:
Serializable
,Comparable<StringMatcher.Mode>
,java.lang.constant.Constable
- Enclosing class:
StringMatcher
Defines the mode a
StringMatcher
compares to strings with.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionChecks if a string contains another string with respecting casing differences.Checks if a string contains another string without respecting casing differences.Checks if a string ends with a second string with respecting casing differences.Checks if a string ends with a second string without respecting casing differences.Checks if two strings equal and respects casing differences.Checks if two strings equal without respecting casing differences.Checks if a string can be matched by a regular expression.Checks if a string starts with the a second string with respecting casing differences.Checks if a string starts with a second string without respecting casing differences. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
A description of the string for providing meaningfulObject.toString()
implementations for method matchers that rely on a match mode. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Returns the description of this match mode.protected abstract boolean
Matches a string against another string.static StringMatcher.Mode
Returns the enum constant of this type with the specified name.static StringMatcher.Mode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
EQUALS_FULLY
Checks if two strings equal and respects casing differences. -
EQUALS_FULLY_IGNORE_CASE
Checks if two strings equal without respecting casing differences. -
STARTS_WITH
Checks if a string starts with the a second string with respecting casing differences. -
STARTS_WITH_IGNORE_CASE
Checks if a string starts with a second string without respecting casing differences. -
ENDS_WITH
Checks if a string ends with a second string with respecting casing differences. -
ENDS_WITH_IGNORE_CASE
Checks if a string ends with a second string without respecting casing differences. -
CONTAINS
Checks if a string contains another string with respecting casing differences. -
CONTAINS_IGNORE_CASE
Checks if a string contains another string without respecting casing differences. -
MATCHES
Checks if a string can be matched by a regular expression.
-
-
Field Details
-
description
A description of the string for providing meaningfulObject.toString()
implementations for method matchers that rely on a match mode.
-
-
Constructor Details
-
Mode
Creates a new match mode.- Parameters:
description
- The description of this mode for providing meaningfulObject.toString()
implementations.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getDescription
Returns the description of this match mode.- Returns:
- The description of this match mode.
-
matches
Matches a string against another string.- Parameters:
expected
- The target of the comparison against which theactual
string is compared.actual
- The source which is subject of the comparison to theexpected
value.- Returns:
true
if the source matches the target.
-