Interface Binder

All Known Subinterfaces:
Context

public interface Binder
A Binder provides the ability to create Bindings.
Since:
Oct-2024
Author:
brian.oliver
See Also:
  • Method Details

    • bind

      <T> BindingBuilder<T> bind(Class<T> bindingClass)
      Creates a new fluent BindingBuilder for the specified Class of Binding, allowing definition, configuration and construction of a Binding.
      Type Parameters:
      T - the type of Binding
      Parameters:
      bindingClass - the Class for which to create a Binding
      Returns:
      a new BindingBuilder
    • bindSet

      <T> MultiBinder<T> bindSet(Class<T> type)
      Returns a MultiBinder for the specified element type, creating it if it does not yet exist. Multiple calls for the same type (e.g. from two different Modules) accumulate into the same underlying set.
      Type Parameters:
      T - the element type
      Parameters:
      type - the element Class
      Returns:
      the MultiBinder for the element type
    • install

      default Binder install(Module module)
      Installs the specified Module, applying its bindings to this Binder.
      Parameters:
      module - the Module to install
      Returns:
      this Binder to permit fluent-style method invocation
    • configure

      default Binder configure(Consumer<? super Binder> consumer)
      Configures the Binder using the specified Consumer.
      Parameters:
      consumer - the Consumer
      Returns:
      this Binder to permit fluent-style method invocation