Enum Class ScopedSupplier
- All Implemented Interfaces:
Serializable,Comparable<ScopedSupplier>,Constable
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
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionWhen 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.Once a supplier is instantiated for singleton scope, it should provide only one instance of the supplied element for that instance.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 TypeMethodDescription<T> Supplier<T> static ScopedSupplierReturns the enum constant of this class with the specified name.static ScopedSupplier[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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
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
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
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
supplier
-