Package org.itsallcode.matcher
Class MultilineTextMatcher
- java.lang.Object
-
- org.hamcrest.BaseMatcher<T>
-
- org.hamcrest.TypeSafeMatcher<String>
-
- org.itsallcode.matcher.MultilineTextMatcher
-
-
Constructor Summary
Constructors Constructor Description MultilineTextMatcher(String originalText)Create a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddescribeMismatchSafely(String text, org.hamcrest.Description mismatchDescription)voiddescribeTo(org.hamcrest.Description description)static MultilineTextMatchermatchesAllLines(String... lines)Factory method for multi-line text matcherbooleanmatchesSafely(String text)Match the text against the original text.
-
-
-
Constructor Detail
-
MultilineTextMatcher
public MultilineTextMatcher(String originalText)
Create a new instance.- Parameters:
originalText- the original text
-
-
Method Detail
-
matchesSafely
public boolean matchesSafely(String text)
Match the text against the original text. A full match (including line separators) is required.- Specified by:
matchesSafelyin classorg.hamcrest.TypeSafeMatcher<String>- Parameters:
text- the text to be matched against the original text.
-
describeMismatchSafely
protected void describeMismatchSafely(String text, org.hamcrest.Description mismatchDescription)
- Overrides:
describeMismatchSafelyin classorg.hamcrest.TypeSafeMatcher<String>
-
describeTo
public void describeTo(org.hamcrest.Description description)
-
matchesAllLines
public static MultilineTextMatcher matchesAllLines(String... lines)
Factory method for multi-line text matcher- Parameters:
lines- the expected lines- Returns:
- the matcher
-
-