Class MatchesRegex

  • All Implemented Interfaces:
    org.hamcrest.Matcher<java.lang.String>, org.hamcrest.SelfDescribing

    public class MatchesRegex
    extends org.hamcrest.BaseMatcher<java.lang.String>
    Checks that the matching string matches the regex.
    • Constructor Summary

      Constructors 
      Constructor Description
      MatchesRegex​(java.lang.String regex)  
      MatchesRegex​(java.util.regex.Pattern pattern)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void describeMismatch​(java.lang.Object item, org.hamcrest.Description description)  
      void describeTo​(org.hamcrest.Description description)  
      boolean matches​(java.lang.Object item)  
      • 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

      • MatchesRegex

        public MatchesRegex​(java.lang.String regex)
      • MatchesRegex

        public MatchesRegex​(java.util.regex.Pattern pattern)
    • Method Detail

      • matches

        public boolean matches​(java.lang.Object item)
      • describeTo

        public void describeTo​(org.hamcrest.Description description)
      • describeMismatch

        public void describeMismatch​(java.lang.Object item,
                                     org.hamcrest.Description description)
        Specified by:
        describeMismatch in interface org.hamcrest.Matcher<java.lang.String>
        Overrides:
        describeMismatch in class org.hamcrest.BaseMatcher<java.lang.String>