| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | describeTo(Description
The description to be built or appended to. description)Implements org. |
| public static Matcher | Returns: The matcher.the pattern to be used. pattern)Creates a matcher that checks if the examined string matches a specified |
| public static Matcher | Returns: The matcher.The regex to be used for the validation. regex)Creates a matcher that checks if the examined string matches a specified regex. |
| protected boolean | matchesSafely(String actual, Description mismatchDescription)
Implements abstract org. |
| pattern | back to summary |
|---|---|
| private Pattern pattern | |
| StringRegularExpression | back to summary |
|---|---|
| protected StringRegularExpression(Pattern pattern) | |
| describeTo | back to summary |
|---|---|
| public void describeTo(Description description) Implements org. Doc from org. Generates a description of the object. The description may be part of a a description of a larger object of which this is just a component, so it should be worded appropriately.
| |
| matchesRegex | back to summary |
|---|---|
| public static Matcher Creates a matcher that checks if the examined string matches a specified
assertThat("abc", matchesRegex(Pattern.compile("ˆ[a-z]$"));
| |
| matchesRegex | back to summary |
|---|---|
| public static Matcher Creates a matcher that checks if the examined string matches a specified regex.
assertThat("abc", matchesRegex("ˆ[a-z]+$"));
| |
| matchesSafely | back to summary |
|---|---|
| protected boolean matchesSafely(String actual, Description mismatchDescription) Implements abstract org. Doc from org. Subclasses should implement this. The item will already have been checked for the specific type and will never be null.
| |