org.hamcrest.text
Class MatchesPattern

java.lang.Object
  extended by org.hamcrest.BaseMatcher<T>
      extended by org.hamcrest.TypeSafeMatcher<String>
          extended by org.hamcrest.text.MatchesPattern
All Implemented Interfaces:
Matcher<String>, SelfDescribing

public class MatchesPattern
extends TypeSafeMatcher<String>


Constructor Summary
MatchesPattern(Pattern pattern)
           
 
Method Summary
 void describeTo(Description description)
           
static Matcher<String> matchesPattern(Pattern pattern)
          Creates a matcher of String that matches when the examined string exactly matches the given Pattern.
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.
protected  boolean matchesSafely(String item)
           
 
Methods inherited from class org.hamcrest.TypeSafeMatcher
describeMismatch, describeMismatchSafely, matches
 
Methods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MatchesPattern

public MatchesPattern(Pattern pattern)
Method Detail

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.