Package org.takes.facets.hamcrest
Class AbstractHmTextBody<T>
- java.lang.Object
-
- org.hamcrest.BaseMatcher<T>
-
- org.hamcrest.TypeSafeMatcher<T>
-
- org.takes.facets.hamcrest.AbstractHmTextBody<T>
-
- Type Parameters:
T
- Item type. Should be able to return own body
- All Implemented Interfaces:
org.hamcrest.Matcher<T>
,org.hamcrest.SelfDescribing
- Direct Known Subclasses:
HmRqTextBody
,HmRsTextBody
public abstract class AbstractHmTextBody<T> extends org.hamcrest.TypeSafeMatcher<T>
Text body matcher.This "matcher" tests given item body, assuming that it has text content.
The class is immutable and thread-safe.
- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description AbstractHmTextBody(org.hamcrest.Matcher<String> body, Charset charset)
Ctor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
describeMismatchSafely(T item, org.hamcrest.Description description)
void
describeTo(org.hamcrest.Description description)
protected abstract InputStream
itemBody(T item)
Item's body.protected boolean
matchesSafely(T item)
-
-
-
Method Detail
-
describeTo
public final void describeTo(org.hamcrest.Description description)
-
matchesSafely
protected final boolean matchesSafely(T item)
- Specified by:
matchesSafely
in classorg.hamcrest.TypeSafeMatcher<T>
-
describeMismatchSafely
protected final void describeMismatchSafely(T item, org.hamcrest.Description description)
- Overrides:
describeMismatchSafely
in classorg.hamcrest.TypeSafeMatcher<T>
-
itemBody
protected abstract InputStream itemBody(T item) throws IOException
Item's body.- Parameters:
item
- Item to retrieve body from- Returns:
- InputStream of body
- Throws:
IOException
- If some problem inside
-
-