public class Extractors extends Object
For example:
assertThat(objectsList).extracting(toStringMethod()).contains("toString 1", "toString 2");
assertThat(objectsList).extracting(byName("field")).contains("someResult1", "someResult2");| Constructor and Description |
|---|
Extractors() |
| Modifier and Type | Method and Description |
|---|---|
static <F> Extractor<F,Tuple> |
byName(String... fieldsOrProperties)
Provides extractor for extracting multiple fields or properties from any object using reflection
|
static <F> Extractor<F,Object> |
byName(String fieldOrProperty)
Provides extractor for extracting single field or property from any object using reflection
|
static String |
extractedDescriptionOf(String... propertiesOrFields) |
static String |
extractedDescriptionOfMethod(String method) |
static <F> Extractor<F,Object> |
resultOf(String methodName)
Provides extractor for extracting values by method name from any object using reflection
|
static Extractor<Object,String> |
toStringMethod()
Provides extractor for extracting
Object.toString() from any object |
public static Extractor<Object,String> toStringMethod()
Object.toString() from any objectExtractorpublic static <F> Extractor<F,Object> byName(String fieldOrProperty)
F - type to extract property fromfieldOrProperty - the name of the field/property to extractExtractorpublic static <F> Extractor<F,Tuple> byName(String... fieldsOrProperties)
F - type to extract property fromfieldsOrProperties - the name of the fields/properties to extractExtractorpublic static <F> Extractor<F,Object> resultOf(String methodName)
F - type to extract property frommethodName - the name of the method to executeExtractorCopyright © 2014–2018 AssertJ. All rights reserved.