Top Description Fields Constructors Methods
org.assertj.core.error

public Class ClassModifierShouldBe

extends BasicErrorMessageFactory
Class Inheritance
Static Imports
java.lang.reflect.Modifier.isPrivate, .Modifier.isProtected, .Modifier.isPublic

Error message factory for an assertion which checks that a class has (or has not) a specific modifier.
Author
Michal Kordas

Field Summary

Modifier and TypeField and Description
private static final String
Inherited from org.assertj.core.error.BasicErrorMessageFactory:
argumentsformatformatter

Constructor Summary

AccessConstructor and Description
private
ClassModifierShouldBe(Class<?> actual, boolean positive, String modifier)

Method Summary

Modifier and TypeMethod and Description
private static String
modifiers(Class<?> actual)

public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldBeFinal
(Class<?>
the actual value in the failed assertion.
actual
)

Creates a new instance for a positive check of the final modifier.

public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldBePackagePrivate
(Class<?>
the actual value in the failed assertion.
actual
)

Creates a new instance for a positive check of the package-private modifier.

public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldBePrivate
(Class<?>
the actual value in the failed assertion.
actual
)

Creates a new instance for a positive check of the private modifier.

public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldBeProtected
(Class<?>
the actual value in the failed assertion.
actual
)

Creates a new instance for a positive check of the protected modifier.

public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldBePublic
(Class<?>
the actual value in the failed assertion.
actual
)

Creates a new instance for a positive check of the public modifier.

public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldBeStatic
(Class<?>
the actual value in the failed assertion.
actual
)

Creates a new instance for a positive check of the static modifier.

public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldNotBeFinal
(Class<?>
the actual value in the failed assertion.
actual
)

Creates a new instance for a negative check of the final modifier.

public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldNotBeStatic
(Class<?>
the actual value in the failed assertion.
actual
)

Creates a new instance for a negative check of the static modifier.

Inherited from org.assertj.core.error.BasicErrorMessageFactory:
createcreatecreateequalshashCodetoStringunquotedString

Field Detail

PACKAGE_PRIVATEback to summary
private static final String PACKAGE_PRIVATE

Constructor Detail

ClassModifierShouldBeback to summary
private ClassModifierShouldBe(Class<?> actual, boolean positive, String modifier)

Method Detail

modifiersback to summary
private static String modifiers(Class<?> actual)
shouldBeFinalback to summary
public static ErrorMessageFactory shouldBeFinal(Class<?> actual)

Creates a new instance for a positive check of the final modifier.

Parameters
actual:Class<?>

the actual value in the failed assertion.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.

shouldBePackagePrivateback to summary
public static ErrorMessageFactory shouldBePackagePrivate(Class<?> actual)

Creates a new instance for a positive check of the package-private modifier.

Parameters
actual:Class<?>

the actual value in the failed assertion.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.

shouldBePrivateback to summary
public static ErrorMessageFactory shouldBePrivate(Class<?> actual)

Creates a new instance for a positive check of the private modifier.

Parameters
actual:Class<?>

the actual value in the failed assertion.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.

shouldBeProtectedback to summary
public static ErrorMessageFactory shouldBeProtected(Class<?> actual)

Creates a new instance for a positive check of the protected modifier.

Parameters
actual:Class<?>

the actual value in the failed assertion.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.

shouldBePublicback to summary
public static ErrorMessageFactory shouldBePublic(Class<?> actual)

Creates a new instance for a positive check of the public modifier.

Parameters
actual:Class<?>

the actual value in the failed assertion.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.

shouldBeStaticback to summary
public static ErrorMessageFactory shouldBeStatic(Class<?> actual)

Creates a new instance for a positive check of the static modifier.

Parameters
actual:Class<?>

the actual value in the failed assertion.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.

shouldNotBeFinalback to summary
public static ErrorMessageFactory shouldNotBeFinal(Class<?> actual)

Creates a new instance for a negative check of the final modifier.

Parameters
actual:Class<?>

the actual value in the failed assertion.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.

shouldNotBeStaticback to summary
public static ErrorMessageFactory shouldNotBeStatic(Class<?> actual)

Creates a new instance for a negative check of the static modifier.

Parameters
actual:Class<?>

the actual value in the failed assertion.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.