ofType
public <T> FieldSupplierBuilder.NameAndAnnotationFieldSupplier<T> ofType(Class<T> fieldType)
Find a field based on a type. E.g.
await().until(fieldIn(object).ofType(int.class), equalTo(2));
You can also specify the field more accurately by continuing the statement:
E.g.
await().until(fieldIn(object).ofType(int.class).andWithName("fieldName"), equalTo(2));
or
await().until(fieldIn(object).ofType(int.class).andAnnotatedWith(MyAnnotation.class).andWithName("fieldName"), equalTo(2));
- Type Parameters:
T - The type of the field- Parameters:
fieldType - The type of the field.
- Returns:
- The field supplier