public static enum StringMatcher.Mode extends Enum<StringMatcher.Mode>
StringMatcher
compares to strings with.Enum Constant and Description |
---|
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.
|
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.
|
EQUALS_FULLY
Checks if two strings equal and respects casing differences.
|
EQUALS_FULLY_IGNORE_CASE
Checks if two strings equal without respecting casing differences.
|
MATCHES
Checks if a string can be matched by a regular expression.
|
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.
|
Modifier and Type | Method and Description |
---|---|
protected String |
getDescription()
Returns the description of this match mode.
|
protected abstract boolean |
matches(String expected,
String actual)
Matches a string against another string.
|
static StringMatcher.Mode |
valueOf(String name)
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.
|
public static final StringMatcher.Mode EQUALS_FULLY
public static final StringMatcher.Mode EQUALS_FULLY_IGNORE_CASE
public static final StringMatcher.Mode STARTS_WITH
public static final StringMatcher.Mode STARTS_WITH_IGNORE_CASE
public static final StringMatcher.Mode ENDS_WITH
public static final StringMatcher.Mode ENDS_WITH_IGNORE_CASE
public static final StringMatcher.Mode CONTAINS
public static final StringMatcher.Mode CONTAINS_IGNORE_CASE
public static final StringMatcher.Mode MATCHES
public static StringMatcher.Mode[] values()
for (StringMatcher.Mode c : StringMatcher.Mode.values()) System.out.println(c);
public static StringMatcher.Mode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullprotected String getDescription()
protected abstract boolean matches(String expected, String actual)
expected
- The target of the comparison against which the actual
string is compared.actual
- The source which is subject of the comparison to the expected
value.true
if the source matches the target.Copyright © 2014–2025. All rights reserved.