Enum ThreadSafety.Purpose
- java.lang.Object
-
- java.lang.Enum<ThreadSafety.Purpose>
-
- com.google.errorprone.bugpatterns.threadsafety.ThreadSafety.Purpose
-
- All Implemented Interfaces:
Serializable
,Comparable<ThreadSafety.Purpose>
- Enclosing class:
- ThreadSafety
public static enum ThreadSafety.Purpose extends Enum<ThreadSafety.Purpose>
TheThreadSafety
utility class can be used by either the bug checker that enforces immutability or by the bug checker that enforces thread-safety. Depending on which of these bug checkers is using this utility, different messages become appropriate.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description FOR_IMMUTABLE_CHECKER
This is being used by the immutability bug checkerFOR_THREAD_SAFE_CHECKER
This is being used by the thread-safety bug checker
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ThreadSafety.Purpose
valueOf(String name)
Returns the enum constant of this type with the specified name.static ThreadSafety.Purpose[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
FOR_IMMUTABLE_CHECKER
public static final ThreadSafety.Purpose FOR_IMMUTABLE_CHECKER
This is being used by the immutability bug checker
-
FOR_THREAD_SAFE_CHECKER
public static final ThreadSafety.Purpose FOR_THREAD_SAFE_CHECKER
This is being used by the thread-safety bug checker
-
-
Method Detail
-
values
public static ThreadSafety.Purpose[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ThreadSafety.Purpose c : ThreadSafety.Purpose.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ThreadSafety.Purpose valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
-