public final class IsBlankString extends TypeSafeMatcher<java.lang.String>
Modifier and Type | Method and Description |
---|---|
static Matcher<java.lang.String> |
blankOrNullString()
Creates a matcher of
String that matches when the examined string is null , or
contains zero or more whitespace characters and nothing else. |
static Matcher<java.lang.String> |
blankString()
Creates a matcher of
String that matches when the examined string contains
zero or more whitespace characters and nothing else. |
void |
describeTo(Description description)
Generates a description of the object.
|
boolean |
matchesSafely(java.lang.String item)
Subclasses should implement this.
|
describeMismatch, describeMismatchSafely, matches
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
public boolean matchesSafely(java.lang.String item)
TypeSafeMatcher
matchesSafely
in class TypeSafeMatcher<java.lang.String>
public void describeTo(Description description)
SelfDescribing
description
- The description to be built or appended to.public static Matcher<java.lang.String> blankString()
String
that matches when the examined string contains
zero or more whitespace characters and nothing else.
For example:
assertThat(" ", is(blankString()))
public static Matcher<java.lang.String> blankOrNullString()
String
that matches when the examined string is null
, or
contains zero or more whitespace characters and nothing else.
For example:
assertThat(((String)null), is(blankOrNullString()))