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:
Modifier
,AnnotationSupport
,ClassSupport
,ReflectionSupport
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isAbstract(Class<?> clazz)
Determine if the supplied class isabstract
.static boolean
isAbstract(Member member)
Determine if the supplied member isabstract
.static boolean
Determine if the supplied class isfinal
.static boolean
Determine if the supplied member isfinal
.static boolean
isNotFinal(Class<?> clazz)
Determine if the supplied class is notfinal
.static boolean
isNotFinal(Member member)
Determine if the supplied member is notfinal
.static boolean
isNotPrivate(Class<?> clazz)
Determine if the supplied class is notprivate
.static boolean
isNotPrivate(Member member)
Determine if the supplied member is notprivate
.static boolean
isNotStatic(Class<?> clazz)
Determine if the supplied class is notstatic
.static boolean
isNotStatic(Member member)
Determine if the supplied member is notstatic
.static boolean
Determine if the supplied class isprivate
.static boolean
Determine if the supplied member isprivate
.static boolean
Determine if the supplied class ispublic
.static boolean
Determine if the supplied member ispublic
.static boolean
Determine if the supplied class isstatic
.static boolean
Determine if the supplied member isstatic
.
-
Method Details
-
isPublic
Determine if the supplied class ispublic
.- Parameters:
clazz
- the class to check; nevernull
- Returns:
true
if the class ispublic
- See Also:
Modifier.isPublic(int)
-
isPublic
Determine if the supplied member ispublic
.- Parameters:
member
- the member to check; nevernull
- Returns:
true
if the member ispublic
- See Also:
Modifier.isPublic(int)
-
isPrivate
Determine if the supplied class isprivate
.- Parameters:
clazz
- the class to check; nevernull
- Returns:
true
if the class isprivate
- See Also:
Modifier.isPrivate(int)
-
isPrivate
Determine if the supplied member isprivate
.- Parameters:
member
- the member to check; nevernull
- Returns:
true
if the member isprivate
- See Also:
Modifier.isPrivate(int)
-
isNotPrivate
Determine if the supplied class is notprivate
.In other words this method will return
true
for classes declared aspublic
,protected
, or package private andfalse
for classes declared asprivate
.- Parameters:
clazz
- the class to check; nevernull
- Returns:
true
if the class is notprivate
- See Also:
Modifier.isPublic(int)
,Modifier.isProtected(int)
,Modifier.isPrivate(int)
-
isNotPrivate
Determine if the supplied member is notprivate
.In other words this method will return
true
for members declared aspublic
,protected
, or package private andfalse
for members declared asprivate
.- Parameters:
member
- the member to check; nevernull
- Returns:
true
if the member is notprivate
- See Also:
Modifier.isPublic(int)
,Modifier.isProtected(int)
,Modifier.isPrivate(int)
-
isAbstract
Determine if the supplied class isabstract
.- Parameters:
clazz
- the class to check; nevernull
- Returns:
true
if the class isabstract
- See Also:
Modifier.isAbstract(int)
-
isAbstract
Determine if the supplied member isabstract
.- Parameters:
member
- the class to check; nevernull
- Returns:
true
if the member isabstract
- See Also:
Modifier.isAbstract(int)
-
isStatic
Determine if the supplied class isstatic
.- Parameters:
clazz
- the class to check; nevernull
- Returns:
true
if the class isstatic
- See Also:
Modifier.isStatic(int)
-
isStatic
Determine if the supplied member isstatic
.- Parameters:
member
- the member to check; nevernull
- Returns:
true
if the member isstatic
- See Also:
Modifier.isStatic(int)
-
isNotStatic
Determine if the supplied class is notstatic
.- Parameters:
clazz
- the class to check; nevernull
- Returns:
true
if the class is notstatic
- See Also:
Modifier.isStatic(int)
-
isNotStatic
Determine if the supplied member is notstatic
.- Parameters:
member
- the member to check; nevernull
- Returns:
true
if the member is notstatic
- See Also:
Modifier.isStatic(int)
-
isFinal
Determine if the supplied class isfinal
.- Parameters:
clazz
- the class to check; nevernull
- Returns:
true
if the class isfinal
- Since:
- 1.5
- See Also:
Modifier.isFinal(int)
-
isNotFinal
Determine if the supplied class is notfinal
.- Parameters:
clazz
- the class to check; nevernull
- Returns:
true
if the class is notfinal
- Since:
- 1.5
- See Also:
Modifier.isFinal(int)
-
isFinal
Determine if the supplied member isfinal
.- Parameters:
member
- the member to check; nevernull
- Returns:
true
if the member isfinal
- Since:
- 1.5
- See Also:
Modifier.isFinal(int)
-
isNotFinal
Determine if the supplied member is notfinal
.- Parameters:
member
- the member to check; nevernull
- Returns:
true
if the member is notfinal
- Since:
- 1.5
- See Also:
Modifier.isFinal(int)
-