Class DI.ScopedBindingBuilder<T>

java.lang.Object
org.apache.logging.log4j.plugins.di.DI.UnscopedBindingBuilder<T>
org.apache.logging.log4j.plugins.di.DI.ScopedBindingBuilder<T>
Type Parameters:
T - type of binding result being registered
Enclosing class:
DI

public static class DI.ScopedBindingBuilder<T> extends DI.UnscopedBindingBuilder<T>
Builder DSL for configuring a scoped binding to be registered with a ConfigurableInstanceFactory.
  • Method Details

    • toProvider

      public DI.FactoryBuilder toProvider(Supplier<? extends T> provider)
      Adds a scoped binding to the given provider function. If no Scope can be found corresponding to the requested scope annotation type, then this provider will be registered as an unscoped binding.
      Parameters:
      provider - unscoped function for creating the binding value
      Returns:
      builder DSL for ConfigurableInstanceFactory