Package org.assertj.core.extractor
Class Extractors
java.lang.Object
org.assertj.core.extractor.Extractors
Extractors factory, providing convenient methods of creating common extractors.
For example:
assertThat(objectsList).extracting(toStringMethod()).contains("toString 1", "toString 2");
assertThat(objectsList).extracting(byName("field")).contains("someResult1", "someResult2");
- Author:
- Mateusz Haligowski
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionProvides extractor for extracting single field or property from any object using reflectionProvides extractor for extracting multiple fields or properties from any object using reflectionstatic String
extractedDescriptionOf
(Object... items) static String
extractedDescriptionOf
(String... itemsDescription) static String
extractedDescriptionOfMethod
(String method) Provides extractor for extracting values by method name from any object using reflectionProvides extractor for extractingObject.toString()
from any object
-
Constructor Details
-
Extractors
public Extractors()
-
-
Method Details
-
toStringMethod
Provides extractor for extractingObject.toString()
from any object- Returns:
- the built
Function
-
byName
Provides extractor for extracting single field or property from any object using reflection- Parameters:
fieldOrProperty
- the name of the field/property to extract- Returns:
- the built
Function
-
byName
Provides extractor for extracting multiple fields or properties from any object using reflection- Parameters:
fieldsOrProperties
- the name of the fields/properties to extract- Returns:
- the built
Function
-
resultOf
Provides extractor for extracting values by method name from any object using reflection- Parameters:
methodName
- the name of the method to execute- Returns:
- the built
Function
-
extractedDescriptionOf
-
extractedDescriptionOf
-
extractedDescriptionOfMethod
-