Top Description Fields Constructors Methods
org.assertj.core.error

public Class ShouldContainSubsequenceOfCharSequence

extends BasicErrorMessageFactory
Class Inheritance
Static Imports
java.lang.String.format, java.util.stream.Collectors.joining

Creates an error message indicating that an assertion that verifies that a CharSequence contains a Subsequence of several CharSequences in order failed.
Authors
Joel Costigliola, Mikhail Mazursky

Field Summary

Inherited from org.assertj.core.error.BasicErrorMessageFactory:
argumentsformatformatter

Constructor Summary

AccessConstructor and Description
private
ShouldContainSubsequenceOfCharSequence(String format, CharSequence actual, CharSequence[] strings, CharSequence foundButBadOrder, CharSequence foundButBadOrder2, ComparisonStrategy comparisonStrategy)

private

Method Summary

Modifier and TypeMethod and Description
private static String

Returns:

the ordinal representation of i
ordinal
(int
the integer to convert
i
)

Returns the ordinal representation of a given integer.

public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldContainSubsequence
(CharSequence
the actual value in the failed assertion.
actual
,
CharSequence[]
the sequence of values expected to be in actual.
strings
,
int
first index failing the subsequence.
firstBadOrderIndex
)

Creates a new ShouldContainSubsequenceOfCharSequence.

public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldContainSubsequence
(CharSequence
the actual value in the failed assertion.
actual
,
CharSequence[]
the sequence of values expected to be in actual.
strings
,
int
index failing the subsequence.
badOrderIndex
,
ComparisonStrategy
the ComparisonStrategy used to evaluate assertion.
comparisonStrategy
)

Creates a new ShouldContainSubsequenceOfCharSequence.

public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldContainSubsequence
(CharSequence
the actual value in the failed assertion.
actual
,
CharSequence[]
the sequence of values expected to be in actual.
strings
,
Map<CharSequence, Integer>
a map where each key is a subsequence of strings that was expected to be found in actual and the corresponding value is the number of times it was expected but not found.
notFoundRepeatedSubsequence
,
ComparisonStrategy
the ComparisonStrategy used to evaluate assertion.
comparisonStrategy
)

Creates a new ShouldContainSubsequenceOfCharSequence with detailed error messages about missing subsequences.

Inherited from org.assertj.core.error.BasicErrorMessageFactory:
createcreatecreateequalshashCodetoStringunquotedString

Constructor Detail

ShouldContainSubsequenceOfCharSequenceback to summary
private ShouldContainSubsequenceOfCharSequence(String format, CharSequence actual, CharSequence[] strings, CharSequence foundButBadOrder, CharSequence foundButBadOrder2, ComparisonStrategy comparisonStrategy)
ShouldContainSubsequenceOfCharSequenceback to summary
private ShouldContainSubsequenceOfCharSequence(String format, CharSequence actual, CharSequence[] strings, ComparisonStrategy comparisonStrategy)

Method Detail

ordinalback to summary
private static String ordinal(int i)

Returns the ordinal representation of a given integer.

This method converts integers to their ordinal form (e.g., 1 to "1st", 2 to "2nd", etc.). Special cases for numbers ending in 11, 12, and 13 are handled to return "th" instead of "st", "nd", or "rd".

Parameters
i:int

the integer to convert

Returns:String

the ordinal representation of i

shouldContainSubsequenceback to summary
public static ErrorMessageFactory shouldContainSubsequence(CharSequence actual, CharSequence[] strings, int firstBadOrderIndex)

Creates a new ShouldContainSubsequenceOfCharSequence.

Parameters
actual:CharSequence

the actual value in the failed assertion.

strings:CharSequence[]

the sequence of values expected to be in actual.

firstBadOrderIndex:int

first index failing the subsequence.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.

shouldContainSubsequenceback to summary
public static ErrorMessageFactory shouldContainSubsequence(CharSequence actual, CharSequence[] strings, int badOrderIndex, ComparisonStrategy comparisonStrategy)

Creates a new ShouldContainSubsequenceOfCharSequence.

Parameters
actual:CharSequence

the actual value in the failed assertion.

strings:CharSequence[]

the sequence of values expected to be in actual.

badOrderIndex:int

index failing the subsequence.

comparisonStrategy:ComparisonStrategy

the ComparisonStrategy used to evaluate assertion.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.

shouldContainSubsequenceback to summary
public static ErrorMessageFactory shouldContainSubsequence(CharSequence actual, CharSequence[] strings, Map<CharSequence, Integer> notFoundRepeatedSubsequence, ComparisonStrategy comparisonStrategy)

Creates a new ShouldContainSubsequenceOfCharSequence with detailed error messages about missing subsequences.

Parameters
actual:CharSequence

the actual value in the failed assertion.

strings:CharSequence[]

the sequence of values expected to be in actual.

notFoundRepeatedSubsequence:Map<CharSequence, Integer>

a map where each key is a subsequence of strings that was expected to be found in actual and the corresponding value is the number of times it was expected but not found.

comparisonStrategy:ComparisonStrategy

the ComparisonStrategy used to evaluate assertion.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.