Package org.assertj.core.groups
Class FieldsOrPropertiesExtractor
- java.lang.Object
-
- org.assertj.core.groups.FieldsOrPropertiesExtractor
-
public class FieldsOrPropertiesExtractor extends Object
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
Constructors Constructor Description FieldsOrPropertiesExtractor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
checkObjectToExtractFromIsNotNull(Object object)
static <F,T>
T[]extract(F[] objects, Function<? super F,T> extractor)
Callextract(Iterable, Function)
after converting objects to an iterable.static <F,T>
List<T>extract(Iterable<? extends F> objects, Function<? super F,T> extractor)
Behavior is described inAbstractIterableAssert.extracting(Function)
-
-
-
Method Detail
-
extract
public static <F,T> T[] extract(F[] objects, Function<? super F,T> extractor)
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
-
checkObjectToExtractFromIsNotNull
private static void checkObjectToExtractFromIsNotNull(Object object)
-
-