Class BindingBuilder<B extends InjectorBuilder<B,I>, I extends Injector<I,B>>

java.lang.Object
honeyroasted.fill.bindings.BindingBuilder<B,I>

public class BindingBuilder<B extends InjectorBuilder<B,I>, I extends Injector<I,B>> extends Object
An intermediate builder that takes a Matcher and ReflectionInjectorBuilder and constructs a Binding and adds it to the ReflectionInjectorBuilder
  • Constructor Details

    • BindingBuilder

      public BindingBuilder(Matcher matcher, B builder)
      Creates a new BindingBuilder
      Parameters:
      matcher - The matcher to build from
      builder - The parent builder
  • Method Details

    • toInstance

      public B toInstance(Object instance)
      Creates a binding with the given instance and adds it to the parent builder
      Parameters:
      instance - The instance to use
      Returns:
      The parent builder, for method chaining
    • toProvider

      public B toProvider(Supplier<Object> provider)
      Creates a binding with the given provider and adds it to the parent builder
      Parameters:
      provider - The provider to use
      Returns:
      The parent builder, for method chaining
    • toFactory

      public B toFactory(Function<InjectionTarget, Object> factory)
      Creates a binding with the given factory and adds it to the parent builder
      Parameters:
      factory - The instance to use
      Returns:
      The parent builder, for method chaining
    • to

      public B to(BiFunction<InjectionTarget, honeyroasted.jype.system.JTypeSystem, InjectionResult> factory)
      Creates a binding with the given factory and adds it to the parent builder
      Parameters:
      factory - The instance to use
      Returns:
      The parent builder, for method chaining