public class StringTextMatcher extends Object implements TextMatcher
String
values. Matching is perform by equality or by regular
expression matching.Constructor and Description |
---|
StringTextMatcher(String... values)
Creates a new
StringTextMatcher . |
Modifier and Type | Method and Description |
---|---|
String |
description()
Returns "value" if this matcher contains only one value, or "values" if this matcher contains more than one
value.
|
String |
formattedValues()
Returns the
String values in this matcher, formatted as a single String . |
boolean |
isMatching(String text)
Indicates whether the given text matches the
String values in this matcher. |
public StringTextMatcher(String... values)
StringTextMatcher
.values
- the String
values to match. Each value can be a regular expression.NullPointerException
- if the array of values is null
.IllegalArgumentException
- if the array of values is empty.public boolean isMatching(String text)
String
values in this matcher. Each value can be a
regular expression.isMatching
in interface TextMatcher
text
- the text to verify.true
if the given text matches the String
values in this matcher,
false
otherwise.public String description()
description
in interface TextMatcher
public String formattedValues()
String
values in this matcher, formatted as a single String
.formattedValues
in interface TextMatcher
String
values in this matcher, formatted as a single String
.Copyright © 2007-2013 FEST (Fixtures for Easy Software Testing). All Rights Reserved.