Interface MultiBinder<T>
- Type Parameters:
T- the element type
public interface MultiBinder<T>
Accumulates multiple bindings for the same type, making them injectable as
Set, Collection,
Iterable, Stream, or List. Obtain a MultiBinder via
Binder.bindSet(Class).
Calling Binder.bindSet(Class) multiple times for the same element type (e.g. from two different
Modules) returns the same underlying binder so entries accumulate naturally across modules.
- Since:
- Apr-2026
- Author:
- reed.vonredwitz
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionAdds a binding by implementation class, which is instantiated via theContextat injection time.Adds a binding via supplier, which is called at injection time to produce the value.Adds a pre-constructed value to the set.
-
Method Details
-
add
Adds a pre-constructed value to the set.- Parameters:
value- the value- Returns:
- this
MultiBinderfor chaining
-
add
Adds a binding by implementation class, which is instantiated via theContextat injection time.- Parameters:
implementationClass- the implementation class- Returns:
- this
MultiBinderfor chaining
-
add
Adds a binding via supplier, which is called at injection time to produce the value.- Parameters:
supplier- the supplier- Returns:
- this
MultiBinderfor chaining
-