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>, java.lang.constant.Constable
Enclosing class:
ThreadSafety

public static enum ThreadSafety.Purpose extends Enum<ThreadSafety.Purpose>
The ThreadSafety 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 Details

    • 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 Details

    • values

      public static ThreadSafety.Purpose[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      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 name
      NullPointerException - if the argument is null