Class ModifierSupport
java.lang.Object
org.junit.platform.commons.support.ModifierSupport
ModifierSupport provides static utility methods for working with
class and member modifiers —
for example, to determine if a class or member is declared as
public, private, abstract, static, etc.
TestEngine and extension
authors are encouraged to use these supported methods in order to align with
the behavior of the JUnit Platform.
- Since:
- 1.4
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisAbstract(Class<?> clazz) Determine if the supplied class isabstract.static booleanisAbstract(Member member) Determine if the supplied member isabstract.static booleanDetermine if the supplied class isfinal.static booleanDetermine if the supplied member isfinal.static booleanisNotAbstract(Class<?> clazz) Determine if the supplied class is notabstract.static booleanisNotAbstract(Member member) Determine if the supplied member is notabstract.static booleanisNotFinal(Class<?> clazz) Determine if the supplied class is notfinal.static booleanisNotFinal(Member member) Determine if the supplied member is notfinal.static booleanisNotPrivate(Class<?> clazz) Determine if the supplied class is notprivate.static booleanisNotPrivate(Member member) Determine if the supplied member is notprivate.static booleanisNotStatic(Class<?> clazz) Determine if the supplied class is notstatic.static booleanisNotStatic(Member member) Determine if the supplied member is notstatic.static booleanDetermine if the supplied class isprivate.static booleanDetermine if the supplied member isprivate.static booleanDetermine if the supplied class ispublic.static booleanDetermine if the supplied member ispublic.static booleanDetermine if the supplied class isstatic.static booleanDetermine if the supplied member isstatic.
-
Method Details
-
isPublic
Determine if the supplied class ispublic.- Parameters:
clazz- the class to check; nevernull- Returns:
trueif the class ispublic- See Also:
-
isPublic
Determine if the supplied member ispublic.- Parameters:
member- the member to check; nevernull- Returns:
trueif the member ispublic- See Also:
-
isPrivate
Determine if the supplied class isprivate.- Parameters:
clazz- the class to check; nevernull- Returns:
trueif the class isprivate- See Also:
-
isPrivate
Determine if the supplied member isprivate.- Parameters:
member- the member to check; nevernull- Returns:
trueif the member isprivate- See Also:
-
isNotPrivate
Determine if the supplied class is notprivate.In other words this method will return
truefor classes declared aspublic,protected, or package private andfalsefor classes declared asprivate.- Parameters:
clazz- the class to check; nevernull- Returns:
trueif the class is notprivate- See Also:
-
isNotPrivate
Determine if the supplied member is notprivate.In other words this method will return
truefor members declared aspublic,protected, or package private andfalsefor members declared asprivate.- Parameters:
member- the member to check; nevernull- Returns:
trueif the member is notprivate- See Also:
-
isAbstract
Determine if the supplied class isabstract.- Parameters:
clazz- the class to check; nevernull- Returns:
trueif the class isabstract- See Also:
-
isAbstract
Determine if the supplied member isabstract.- Parameters:
member- the class to check; nevernull- Returns:
trueif the member isabstract- See Also:
-
isNotAbstract
Determine if the supplied class is notabstract.- Parameters:
clazz- the class to check; nevernull- Returns:
trueif the class is notabstract- Since:
- 1.13
- See Also:
-
isNotAbstract
Determine if the supplied member is notabstract.- Parameters:
member- the class to check; nevernull- Returns:
trueif the member is notabstract- Since:
- 1.13
- See Also:
-
isStatic
Determine if the supplied class isstatic.- Parameters:
clazz- the class to check; nevernull- Returns:
trueif the class isstatic- See Also:
-
isStatic
Determine if the supplied member isstatic.- Parameters:
member- the member to check; nevernull- Returns:
trueif the member isstatic- See Also:
-
isNotStatic
Determine if the supplied class is notstatic.- Parameters:
clazz- the class to check; nevernull- Returns:
trueif the class is notstatic- See Also:
-
isNotStatic
Determine if the supplied member is notstatic.- Parameters:
member- the member to check; nevernull- Returns:
trueif the member is notstatic- See Also:
-
isFinal
Determine if the supplied class isfinal.- Parameters:
clazz- the class to check; nevernull- Returns:
trueif the class isfinal- Since:
- 1.5
- See Also:
-
isNotFinal
Determine if the supplied class is notfinal.- Parameters:
clazz- the class to check; nevernull- Returns:
trueif the class is notfinal- Since:
- 1.5
- See Also:
-
isFinal
Determine if the supplied member isfinal.- Parameters:
member- the member to check; nevernull- Returns:
trueif the member isfinal- Since:
- 1.5
- See Also:
-
isNotFinal
Determine if the supplied member is notfinal.- Parameters:
member- the member to check; nevernull- Returns:
trueif the member is notfinal- Since:
- 1.5
- See Also:
-