Class ShouldMatch

  • All Implemented Interfaces:
    ErrorMessageFactory

    public class ShouldMatch
    extends BasicErrorMessageFactory
    Creates an error message indicating that an assertion that verifies that a value satisfies a Predicate failed.
    • Field Detail

      • ADVICE

        public static final java.lang.String ADVICE
    • Constructor Detail

      • ShouldMatch

        private ShouldMatch​(java.lang.Object actual,
                            java.util.function.Predicate<?> predicate,
                            PredicateDescription description)
    • Method Detail

      • shouldMatch

        public static <T> ErrorMessageFactory shouldMatch​(T actual,
                                                          java.util.function.Predicate<? super T> predicate,
                                                          PredicateDescription predicateDescription)
        Creates a new ShouldMatch.
        Type Parameters:
        T - guarantees that the type of the actual value and the generic type of the Predicate are the same.
        Parameters:
        actual - the actual value in the failed assertion.
        predicate - the Predicate.
        predicateDescription - predicate description to include in the error message
        Returns:
        the created ErrorMessageFactory.