org.hamcrest.text
Class MatchesPattern
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeMatcher<String>
org.hamcrest.text.MatchesPattern
- All Implemented Interfaces:
- Matcher<String>, SelfDescribing
public class MatchesPattern
- extends TypeSafeMatcher<String>
MatchesPattern
public MatchesPattern(Pattern pattern)
matchesSafely
protected boolean matchesSafely(String item)
- Specified by:
matchesSafely in class TypeSafeMatcher<String>
describeTo
public void describeTo(Description description)
matchesPattern
public static Matcher<String> matchesPattern(Pattern pattern)
- Creates a matcher of
String that matches when the examined string
exactly matches the given Pattern.
matchesPattern
public static Matcher<String> matchesPattern(String regex)
- Creates a matcher of
String that matches when the examined string
exactly matches the given regular expression, treated as a Pattern.
Copyright © 2014. All rights reserved.