org.hamcrest.text
Class IsEmptyString

java.lang.Object
  extended by org.hamcrest.BaseMatcher<T>
      extended by org.hamcrest.TypeSafeMatcher<String>
          extended by org.hamcrest.text.IsEmptyString
All Implemented Interfaces:
Matcher<String>, SelfDescribing

public final class IsEmptyString
extends TypeSafeMatcher<String>

Matches empty Strings (and null).


Method Summary
 void describeTo(Description description)
           
static Matcher<String> emptyOrNullString()
          Creates a matcher of String that matches when the examined string is null, or has zero length.
static Matcher<String> emptyString()
          Creates a matcher of String that matches when the examined string has zero length.
static Matcher<String> isEmptyOrNullString()
          Deprecated. use is(emptyOrNullString()) instead
static Matcher<String> isEmptyString()
          Deprecated. use is(emptyString()) instead
 boolean matchesSafely(String item)
           
 
Methods inherited from class org.hamcrest.TypeSafeMatcher
describeMismatch, describeMismatchSafely, matches
 
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
 

Method Detail

matchesSafely

public boolean matchesSafely(String item)
Specified by:
matchesSafely in class TypeSafeMatcher<String>

describeTo

public void describeTo(Description description)

isEmptyString

@Deprecated
public static Matcher<String> isEmptyString()
Deprecated. use is(emptyString()) instead

Creates a matcher of String that matches when the examined string has zero length.

For example:

assertThat("", isEmptyString())


emptyString

public static Matcher<String> emptyString()
Creates a matcher of String that matches when the examined string has zero length.

For example:

assertThat("", is(emptyString()))


isEmptyOrNullString

@Deprecated
public static Matcher<String> isEmptyOrNullString()
Deprecated. use is(emptyOrNullString()) instead

Creates a matcher of String that matches when the examined string is null, or has zero length.

For example:

assertThat(((String)null), isEmptyOrNullString())


emptyOrNullString

public static Matcher<String> emptyOrNullString()
Creates a matcher of String that matches when the examined string is null, or has zero length.

For example:

assertThat(((String)null), is(emptyOrNullString()))



Copyright © 2014. All rights reserved.