public final class ClassQueries extends java.lang.Object
Various utility function queries on classes.
|Constructor and Description|
|Modifier and Type||Method and Description|
Query whether a class is marked as thread-safe.
Query whether an object is thread-safe.
public static boolean isThreadSafe(@Nonnull java.lang.Class<?> cls)
Query whether a class is marked as thread-safe. A class can be marked as thread-safe through applying one of the following annotations:
Note that the
javax.concurrent annotations are not supported, as they do not have
cls- The class.
trueif the class is marked as thread-safe.
public static boolean isThreadSafe(java.lang.Object obj)
obj- The object.
trueif the object is marked as thread-safe. Null objects are trivially considered to be thread-safe.