Package org.assertj.core.error
Class ShouldBeSorted
java.lang.Object
org.assertj.core.error.BasicErrorMessageFactory
org.assertj.core.error.ShouldBeSorted
- All Implemented Interfaces:
ErrorMessageFactory
Creates an error message indicating that an assertion that verifies a group of elements is sorted failed.
A group of elements can be a collection or an array.
A group of elements can be a collection or an array.
-
Field Summary
Fields inherited from class org.assertj.core.error.BasicErrorMessageFactory
arguments, format, formatter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static List
<?> groupAsList
(Object group) Convert the given group (which is either an array or a Collection) to a List.static ErrorMessageFactory
shouldBeSorted
(int i, Object group) Creates a new
.ShouldBeSorted
static ErrorMessageFactory
shouldBeSortedAccordingToGivenComparator
(int i, Object group, Comparator<?> comparator) static ErrorMessageFactory
shouldHaveComparableElementsAccordingToGivenComparator
(Object actual, Comparator<?> comparator) static ErrorMessageFactory
Methods inherited from class org.assertj.core.error.BasicErrorMessageFactory
create, create, create, equals, hashCode, toString, unquotedString
-
Constructor Details
-
ShouldBeSorted
-
-
Method Details
-
shouldBeSorted
Creates a new
.ShouldBeSorted
- Parameters:
i
- the index of elements whose not naturally ordered with the next.group
- the actual group in the failed assertion (either collection or an array).- Returns:
- an instance of
ErrorMessageFactory
.
-
shouldBeSortedAccordingToGivenComparator
public static ErrorMessageFactory shouldBeSortedAccordingToGivenComparator(int i, Object group, Comparator<?> comparator) -
shouldHaveMutuallyComparableElements
-
shouldHaveComparableElementsAccordingToGivenComparator
public static ErrorMessageFactory shouldHaveComparableElementsAccordingToGivenComparator(Object actual, Comparator<?> comparator) -
groupAsList
Convert the given group (which is either an array or a Collection) to a List.- Parameters:
group
- the group to convert- Returns:
- the corresponding List
- Throws:
IllegalArgumentException
- if group can't be converted to a List
-