public static enum StringMatcher.Mode extends java.lang.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 | Field and Description |
---|---|
private java.lang.String |
description
A description of the string for providing meaningful
Object.toString() implementations for
method matchers that rely on a match mode. |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getDescription()
Returns the description of this match mode.
|
protected abstract boolean |
matches(java.lang.String expected,
java.lang.String actual)
Matches a string against another string.
|
static StringMatcher.Mode |
valueOf(java.lang.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
private final java.lang.String description
Object.toString()
implementations for
method matchers that rely on a match mode.public static StringMatcher.Mode[] values()
for (StringMatcher.Mode c : StringMatcher.Mode.values()) System.out.println(c);
public static StringMatcher.Mode valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullprotected java.lang.String getDescription()
protected abstract boolean matches(java.lang.String expected, java.lang.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.