Interface FieldsShould<CONJUNCTION extends FieldsShouldConjunction>

All Superinterfaces:
MembersShould<CONJUNCTION>

public interface FieldsShould<CONJUNCTION extends FieldsShouldConjunction> extends MembersShould<CONJUNCTION>
  • Method Details

    • haveRawType

      @PublicAPI(usage=ACCESS) CONJUNCTION haveRawType(Class<?> type)
      Asserts that fields have a certain raw type.

      E.g.
      
       fields().should().haveRawType(String.class)
       
      would be violated by someField in
      
       class Example {
           Object someField;
       }
      Parameters:
      type - Type fields should have
      Returns:
      A syntax element that can either be used as working rule, or to continue specifying a more complex rule
    • notHaveRawType

      @PublicAPI(usage=ACCESS) CONJUNCTION notHaveRawType(Class<?> type)
      Asserts that fields do not have a certain raw type.

      E.g.
      
       fields().should().notHaveRawType(String.class)
       
      would be violated by someField in
      
       class Example {
           String someField;
       }
      Parameters:
      type - Type fields should not have
      Returns:
      A syntax element that can either be used as working rule, or to continue specifying a more complex rule
    • haveRawType

      @PublicAPI(usage=ACCESS) CONJUNCTION haveRawType(String typeName)
      Asserts that fields have a certain fully qualified name of their raw type.

      E.g.
      
       fields().should().haveRawType(String.class.getName())
       
      would be violated by someField in
      
       class Example {
           Object someField;
       }
      Parameters:
      typeName - Name of type fields should have
      Returns:
      A syntax element that can either be used as working rule, or to continue specifying a more complex rule
    • notHaveRawType

      @PublicAPI(usage=ACCESS) CONJUNCTION notHaveRawType(String typeName)
      Asserts that fields do not have a certain fully qualified name of their raw type.

      E.g.
      
       fields().should().notHaveRawType(String.class.getName())
       
      would be violated by someField in
      
       class Example {
           String someField;
       }
      Parameters:
      typeName - Name of type fields should not have
      Returns:
      A syntax element that can either be used as working rule, or to continue specifying a more complex rule
    • haveRawType

      @PublicAPI(usage=ACCESS) CONJUNCTION haveRawType(DescribedPredicate<? super JavaClass> predicate)
      Asserts that fields have a raw type matching the given predicate.

      E.g.
      
       fields().should().haveRawType(assignableTo(Serializable.class))
       
      would be violated by someField in
      
       class Example {
           Object someField;
       }
      Parameters:
      predicate - A predicate determining which sort of types fields should have
      Returns:
      A syntax element that can either be used as working rule, or to continue specifying a more complex rule
    • notHaveRawType

      @PublicAPI(usage=ACCESS) CONJUNCTION notHaveRawType(DescribedPredicate<? super JavaClass> predicate)
      Asserts that fields do not have a raw type matching the given predicate.

      E.g.
      
       fields().should().notHaveRawType(assignableTo(Serializable.class))
       
      would be violated by someField in
      
       class Example {
           String someField;
       }
      Parameters:
      predicate - A predicate determining which sort of types fields should not have
      Returns:
      A syntax element that can either be used as working rule, or to continue specifying a more complex rule
    • beStatic

      Asserts that fields are static.
      Returns:
      A syntax element that can either be used as working rule, or to continue specifying a more complex rule
    • notBeStatic

      Asserts that fields are non-static.
      Returns:
      A syntax element that can either be used as working rule, or to continue specifying a more complex rule
    • beFinal

      Asserts that fields are final.
      Returns:
      A syntax element that can either be used as working rule, or to continue specifying a more complex rule
    • notBeFinal

      Asserts that fields are non-final.
      Returns:
      A syntax element that can either be used as working rule, or to continue specifying a more complex rule