Package org.assertj.core.groups
Class FieldsOrPropertiesExtractor
java.lang.Object
org.assertj.core.groups.FieldsOrPropertiesExtractor
Understands how to retrieve fields or values from a collection/array of objects.
You just have to give the field/property name or a Function
implementation, a collection/array of objects
and it will extract the list of field/values from the given objects.
- Author:
- Joel Costigliola, Mateusz Haligowski
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <F,
T> T[] Callextract(Iterable, Function)
after converting objects to an iterable.static <F,
T> List <T> Behavior is described inAbstractIterableAssert.extracting(Function)
-
Constructor Details
-
FieldsOrPropertiesExtractor
public FieldsOrPropertiesExtractor()
-
-
Method Details
-
extract
Callextract(Iterable, Function)
after converting objects to an iterable.Behavior is described in javadoc
AbstractObjectArrayAssert.extracting(Function)
- Type Parameters:
F
- type of elements to extract a value fromT
- the extracted value type- Parameters:
objects
- the elements to extract a value fromextractor
- the extractor function- Returns:
- the extracted values
-
extract
public static <F,T> List<T> extract(Iterable<? extends F> objects, Function<? super F, T> extractor) Behavior is described inAbstractIterableAssert.extracting(Function)
- Type Parameters:
F
- type of elements to extract a value fromT
- the extracted value type- Parameters:
objects
- the elements to extract a value fromextractor
- the extractor function- Returns:
- the extracted values
-