Class ShouldHaveAtIndex

  • All Implemented Interfaces:
    ErrorMessageFactory

    public class ShouldHaveAtIndex
    extends BasicErrorMessageFactory
    Creates an error message indicating that an assertion that verifies a group of elements contains a value at a given index that satisfies a Condition failed.
    Author:
    Bo Gotthardt
    • Constructor Detail

      • ShouldHaveAtIndex

        private ShouldHaveAtIndex​(List<? extends T> actual,
                                  Condition<? super T> condition,
                                  Index index,
                                  T found)
    • Method Detail

      • shouldHaveAtIndex

        public static <T> ErrorMessageFactory shouldHaveAtIndex​(List<? extends T> actual,
                                                                Condition<? super T> condition,
                                                                Index index,
                                                                T found)
        Creates a new ShouldHaveAtIndex.
        Type Parameters:
        T - guarantees that the type of the actual value and the generic type of the Condition are the same.
        Parameters:
        actual - the actual value in the failed assertion.
        condition - the Condition.
        index - the index of the expected value.
        found - the value in actual stored under index.
        Returns:
        the created ErrorMessageFactory.