Class ModifierSupport
- java.lang.Object
-
- org.junit.platform.commons.support.ModifierSupport
-
@API(status=MAINTAINED, since="1.4") public final class ModifierSupport extends Object
ModifierSupport
provides static utility methods for working with class and member modifiers — for example, to determine if a class or member is declared aspublic
,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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isAbstract(Class<?> clazz)
Determine if the supplied class isabstract
.static boolean
isAbstract(Member member)
Determine if the supplied member isabstract
.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
isPrivate(Class<?> clazz)
Determine if the supplied class isprivate
.static boolean
isPrivate(Member member)
Determine if the supplied member isprivate
.static boolean
isPublic(Class<?> clazz)
Determine if the supplied class ispublic
.static boolean
isPublic(Member member)
Determine if the supplied member ispublic
.static boolean
isStatic(Class<?> clazz)
Determine if the supplied class isstatic
.static boolean
isStatic(Member member)
Determine if the supplied member isstatic
.
-
-
-
Method Detail
-
isPublic
public static boolean isPublic(Class<?> clazz)
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
public static boolean isPublic(Member member)
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
public static boolean isPrivate(Class<?> clazz)
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
public static boolean isPrivate(Member member)
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
public static boolean isNotPrivate(Class<?> clazz)
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
public static boolean isNotPrivate(Member member)
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
public static boolean isAbstract(Class<?> clazz)
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
public static boolean isAbstract(Member member)
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
public static boolean isStatic(Class<?> clazz)
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
public static boolean isStatic(Member member)
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
public static boolean isNotStatic(Class<?> clazz)
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
public static boolean isNotStatic(Member member)
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)
-
-