Class FieldSupplierBuilder


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

      • object

        private final java.lang.Object object
      • expectedFieldName

        private java.lang.String expectedFieldName
      • expectedFieldType

        private java.lang.Class<?> expectedFieldType
      • expectedAnnotation

        private java.lang.Class<? extends java.lang.annotation.Annotation> expectedAnnotation
    • Constructor Detail

      • FieldSupplierBuilder

        public FieldSupplierBuilder​(java.lang.Object object)

        Constructor for FieldSupplierBuilder.

        Parameters:
        object - a Object object.
    • Method Detail

      • ofType

        public <T> FieldSupplierBuilder.NameAndAnnotationFieldSupplier<T> ofType​(java.lang.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​(java.lang.Object parameterValue,
                                            java.lang.String name)
      • getObject

        java.lang.Object getObject()
      • getExpectedFieldName

        java.lang.String getExpectedFieldName()
      • getExpectedFieldType

        java.lang.Class<?> getExpectedFieldType()
      • getExpectedAnnotation

        java.lang.Class<? extends java.lang.annotation.Annotation> getExpectedAnnotation()