Class FieldSupplierBuilder

java.lang.Object
org.awaitility.core.FieldSupplierBuilder

public class FieldSupplierBuilder extends Object
The field supplier builder allows you to create a supplier based a field.
  • Field Details

    • object

      private final Object object
    • expectedFieldName

      private String expectedFieldName
    • expectedFieldType

      private Class<?> expectedFieldType
    • expectedAnnotation

      private Class<? extends Annotation> expectedAnnotation
  • Constructor Details

    • FieldSupplierBuilder

      public FieldSupplierBuilder(Object object)

      Constructor for FieldSupplierBuilder.

      Parameters:
      object - a Object object.
  • Method Details

    • 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
    • assertNotNullParameter

      private void assertNotNullParameter(Object parameterValue, String name)
    • getObject

      Object getObject()
    • getExpectedFieldName

      String getExpectedFieldName()
    • getExpectedFieldType

      Class<?> getExpectedFieldType()
    • getExpectedAnnotation

      Class<? extends Annotation> getExpectedAnnotation()