withScope abstract method

Spec<T> withScope(
  1. ScopeType type
)

Defines the type of scope this pod belongs to (e.g., singleton, prototype).

  • singleton: one shared instance across the container.
  • prototype: a new instance each time it is requested.

Example

spec.withScope(ScopeType.singleton);

Implementation

Spec<T> withScope(ScopeType type);