Interface FieldsThat<CONJUNCTION extends GivenFieldsConjunction>

All Superinterfaces:
MembersThat<CONJUNCTION>

public interface FieldsThat<CONJUNCTION extends GivenFieldsConjunction>
extends MembersThat<CONJUNCTION>
  • Method Details

    • haveRawType

      @PublicAPI(usage=ACCESS) CONJUNCTION haveRawType​(java.lang.Class<?> type)
      Matches fields by their raw type. Take for example
      
       class Example {
           String someField;
       }
       
      Then someField would be matched by
      fields().that().haveRawType(String.class)
      Parameters:
      type - Type matching fields must have
      Returns:
      A syntax conjunction element, which can be completed to form a full rule
    • doNotHaveRawType

      @PublicAPI(usage=ACCESS) CONJUNCTION doNotHaveRawType​(java.lang.Class<?> type)
      Matches fields that do not have the given raw type. Take for example
      
       class Example {
           String someField;
       }
       
      Then someField would be matched by
      fields().that().doNotHaveRawType(Object.class)
      Parameters:
      type - Type matching fields must not have
      Returns:
      A syntax conjunction element, which can be completed to form a full rule
    • haveRawType

      @PublicAPI(usage=ACCESS) CONJUNCTION haveRawType​(java.lang.String typeName)
      Matches fields by the fully qualified name of their raw type. Take for example
      
       class Example {
           String someField;
       }
       
      Then someField would be matched by
      fields().that().haveRawType(String.class.getName())
      Parameters:
      typeName - Name of type matching fields must have
      Returns:
      A syntax conjunction element, which can be completed to form a full rule
    • doNotHaveRawType

      @PublicAPI(usage=ACCESS) CONJUNCTION doNotHaveRawType​(java.lang.String typeName)
      Matches fields that do not have the given fully qualified name of their raw type. Take for example
      
       class Example {
           String someField;
       }
       
      Then someField would be matched by
      fields().that().doNotHaveRawType(Object.class.getName())
      Parameters:
      typeName - Name of type matching fields must not have
      Returns:
      A syntax conjunction element, which can be completed to form a full rule
    • haveRawType

      @PublicAPI(usage=ACCESS) CONJUNCTION haveRawType​(DescribedPredicate<? super JavaClass> predicate)
      Matches fields where the raw type of those fields matches the given predicate. Take for example
      
       class Example {
           String someField;
       }
       
      Then someField would be matched by
      fields().that().haveRawType(assignableTo(Serializable.class))
      Parameters:
      predicate - A predicate determining which types of fields match
      Returns:
      A syntax conjunction element, which can be completed to form a full rule
    • doNotHaveRawType

      @PublicAPI(usage=ACCESS) CONJUNCTION doNotHaveRawType​(DescribedPredicate<? super JavaClass> predicate)
      Matches fields where the raw type of those fields does not match the given predicate. Take for example
      
       class Example {
           String someField;
       }
       
      Then someField would be matched by
      fields().that().doNotHaveRawType(assignableTo(List.class))
      Parameters:
      predicate - A predicate determining which types of fields do not match
      Returns:
      A syntax conjunction element, which can be completed to form a full rule
    • areStatic

      Matches static fields.
      Returns:
      A syntax conjunction element, which can be completed to form a full rule
    • areNotStatic

      Matches non-static fields.
      Returns:
      A syntax conjunction element, which can be completed to form a full rule
    • areFinal

      Matches final fields.
      Returns:
      A syntax conjunction element, which can be completed to form a full rule
    • areNotFinal

      Matches non-final fields.
      Returns:
      A syntax conjunction element, which can be completed to form a full rule