Enum ScopedSupplier

java.lang.Object
java.lang.Enum<ScopedSupplier>
io.nosqlbench.engine.api.scoping.ScopedSupplier
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ScopedSupplier>, java.lang.constant.Constable

public enum ScopedSupplier
extends java.lang.Enum<ScopedSupplier>
Helper class to consolidate the notions of scoping items over different NB layers of execution.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
  • Enum Constant Summary

    Enum Constants 
    Enum Constant Description
    caller
    When a supplier is instantiated for caller scope, each time the supplier is accessed, it returns a new instance according to the inner supplier's semantics.
    singleton
    Once a supplier is instantiated for singleton scope, it should provide only one instance of the supplied element for that instance.
    thread
    Once a supplier is instantiated for thread scope, it should provide a unique instance of the supplied element for each thread, according to the inner supplier's semantics.
  • Method Summary

    Modifier and Type Method Description
    <T> java.util.function.Supplier<T> supplier​(java.util.function.Supplier<T> supplier)  
    static ScopedSupplier valueOf​(java.lang.String name)
    Returns the enum constant of this type with the specified name.
    static ScopedSupplier[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • singleton

      public static final ScopedSupplier singleton
      Once a supplier is instantiated for singleton scope, it should provide only one instance of the supplied element for that instance. Multiple instances (separately constructed) of the supplier can each provide their own distinct supplied instance.
    • thread

      public static final ScopedSupplier thread
      Once a supplier is instantiated for thread scope, it should provide a unique instance of the supplied element for each thread, according to the inner supplier's semantics.
    • caller

      public static final ScopedSupplier caller
      When a supplier is instantiated for caller scope, each time the supplier is accessed, it returns a new instance according to the inner supplier's semantics.
  • Method Details

    • values

      public static ScopedSupplier[] 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 ScopedSupplier valueOf​(java.lang.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:
      java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
      java.lang.NullPointerException - if the argument is null
    • supplier

      public <T> java.util.function.Supplier<T> supplier​(java.util.function.Supplier<T> supplier)