Package org.assertj.core.error
Class ShouldOnlyHaveElementsOfTypes
- java.lang.Object
-
- org.assertj.core.error.BasicErrorMessageFactory
-
- org.assertj.core.error.ShouldOnlyHaveElementsOfTypes
-
- All Implemented Interfaces:
ErrorMessageFactory
public class ShouldOnlyHaveElementsOfTypes extends BasicErrorMessageFactory
Creates an error message indicating that an assertion that verifies a group of elements contains elements that are not an instance of one of the given types. A group of elements can be an iterable or an array of objects.- Author:
- Martin Winandy
-
-
Field Summary
-
Fields inherited from class org.assertj.core.error.BasicErrorMessageFactory
arguments, format, formatter
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ShouldOnlyHaveElementsOfTypes(Object actual, Class<?>[] types, Iterable<?> nonMatchingElements)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static String
resolveClassNames(Iterable<?> elements)
static ShouldOnlyHaveElementsOfTypes
shouldOnlyHaveElementsOfTypes(Object actual, Class<?>[] types, Iterable<?> mismatches)
Creates a new
.ShouldOnlyHaveElementsOfTypes
-
Methods inherited from class org.assertj.core.error.BasicErrorMessageFactory
create, create, create, equals, hashCode, toString, unquotedString
-
-
-
-
Method Detail
-
shouldOnlyHaveElementsOfTypes
public static ShouldOnlyHaveElementsOfTypes shouldOnlyHaveElementsOfTypes(Object actual, Class<?>[] types, Iterable<?> mismatches)
Creates a new
.ShouldOnlyHaveElementsOfTypes
- Parameters:
actual
- the object value in the failed assertion.types
- the expected classes and interfaces.mismatches
- elements that are not an instance of one of the given types.- Returns:
- the created
ErrorMessageFactory
.
-
-