org.hamcrest.text
Class IsBlankString
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeMatcher<String>
org.hamcrest.text.IsBlankString
- All Implemented Interfaces:
- Matcher<String>, SelfDescribing
public final class IsBlankString
- extends TypeSafeMatcher<String>
Matches blank Strings (and null).
matchesSafely
public boolean matchesSafely(String item)
- Specified by:
matchesSafely in class TypeSafeMatcher<String>
describeTo
public void describeTo(Description description)
blankString
public static Matcher<String> blankString()
- Creates a matcher of
String that matches when the examined string contains
zero or more whitespace characters and nothing else.
For example:
assertThat(" ", is(blankString()))
blankOrNullString
public static Matcher<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.
For example:
assertThat(((String)null), is(blankOrNullString()))
Copyright © 2014. All rights reserved.