Class ClassModifierShouldBe

  • All Implemented Interfaces:
    ErrorMessageFactory

    public class ClassModifierShouldBe
    extends BasicErrorMessageFactory
    Error message factory for an assertion which checks that a class has (or has not) a specific modifier.
    Author:
    Michal Kordas
    • Constructor Detail

      • ClassModifierShouldBe

        private ClassModifierShouldBe​(Class<?> actual,
                                      boolean positive,
                                      String modifier)
    • Method Detail

      • shouldBeFinal

        public static ErrorMessageFactory shouldBeFinal​(Class<?> actual)
        Creates a new instance for a positive check of the final modifier.
        Parameters:
        actual - the actual value in the failed assertion.
        Returns:
        the created ErrorMessageFactory.
      • shouldNotBeFinal

        public static ErrorMessageFactory shouldNotBeFinal​(Class<?> actual)
        Creates a new instance for a negative check of the final modifier.
        Parameters:
        actual - the actual value in the failed assertion.
        Returns:
        the created ErrorMessageFactory.
      • shouldBePublic

        public static ErrorMessageFactory shouldBePublic​(Class<?> actual)
        Creates a new instance for a positive check of the public modifier.
        Parameters:
        actual - the actual value in the failed assertion.
        Returns:
        the created ErrorMessageFactory.
      • shouldBeProtected

        public static ErrorMessageFactory shouldBeProtected​(Class<?> actual)
        Creates a new instance for a positive check of the protected modifier.
        Parameters:
        actual - the actual value in the failed assertion.
        Returns:
        the created ErrorMessageFactory.
      • shouldBePackagePrivate

        public static ErrorMessageFactory shouldBePackagePrivate​(Class<?> actual)
        Creates a new instance for a positive check of the package-private modifier.
        Parameters:
        actual - the actual value in the failed assertion.
        Returns:
        the created ErrorMessageFactory.
      • modifiers

        private static String modifiers​(Class<?> actual)