Enum Scope

java.lang.Object
java.lang.Enum<Scope>
org.openjdk.jmh.annotations.Scope
All Implemented Interfaces:
Serializable, Comparable<Scope>, java.lang.constant.Constable

public enum Scope extends Enum<Scope>
State scope.
  • Enum Constant Details

    • Benchmark

      public static final Scope Benchmark

      Benchmark state scope.

      With benchmark scope, all instances of the same type will be shared across all worker threads.

      Setup and TearDown methods on this state object would be performed by one of the worker threads, and only once per Level. No other threads would ever touch the state object.

    • Group

      public static final Scope Group

      Group state scope.

      With group scope, all instances of the same type will be shared across all threads within the same group. Each thread group will be supplied with its own state object.

      Setup and TearDown methods on this state object would be performed by one of the group threads, and only once per Level. No other threads would ever touch the state object.

      See Also:
    • Thread

      public static final Scope Thread

      Thread state scope.

      With thread scope, all instances of the same type are distinct, even if multiple state objects are injected in the same benchmark

      Setup and TearDown methods on this state object would be performed by single worker thread exclusively, and only once per Level. No other threads would ever touch the state object.

  • Constructor Details

    • Scope

      private Scope()
  • Method Details

    • values

      public static Scope[] 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 Scope 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