Top Description Fields Constructors Methods
org.hamcrest.core

public Class StringEndsWith

extends SubstringMatcher
Class Inheritance
Imports
org.hamcrest.Matcher

Tests if the argument is a string that ends with a specific substring.

Field Summary

Inherited from org.hamcrest.core.SubstringMatcher:
substring

Constructor Summary

AccessConstructor and Description
public
public
StringEndsWith(boolean ignoringCase, String substring)

Method Summary

Modifier and TypeMethod and Description
public static Matcher<String>
endsWith(String
the substring that the returned matcher will expect at the end of any examined string
suffix
)

Creates a matcher that matches if the examined String ends with the specified String.

public static Matcher<String>
endsWithIgnoringCase(String
the substring that the returned matcher will expect at the end of any examined string
suffix
)

Creates a matcher that matches if the examined String ends with the specified String, ignoring case.

protected boolean
Inherited from org.hamcrest.core.SubstringMatcher:
converteddescribeMismatchSafelydescribeTomatchesSafely

Constructor Detail

StringEndsWithback to summary
public StringEndsWith(String substring)
StringEndsWithback to summary
public StringEndsWith(boolean ignoringCase, String substring)

Method Detail

endsWithback to summary
public static Matcher<String> endsWith(String suffix)

Creates a matcher that matches if the examined String ends with the specified String. For example:

assertThat("myStringOfNote", endsWith("Note"))
Parameters
suffix:String

the substring that the returned matcher will expect at the end of any examined string

endsWithIgnoringCaseback to summary
public static Matcher<String> endsWithIgnoringCase(String suffix)

Creates a matcher that matches if the examined String ends with the specified String, ignoring case. For example:

assertThat("myStringOfNote", endsWithIgnoringCase("note"))
Parameters
suffix:String

the substring that the returned matcher will expect at the end of any examined string

evalSubstringOfback to summary
protected boolean evalSubstringOf(String s)

Implements abstract org.hamcrest.core.SubstringMatcher.evalSubstringOf.

Annotations
@Override