Package com.google.inject.multibindings
Annotation Type ProvidesIntoSet
-
@Documented @Target(METHOD) @Retention(RUNTIME) public @interface ProvidesIntoSet
Annotates methods of aModule
to add items to aMultibinder
. The method's return type and binding annotation determines what Set this will contribute to. For example,@ProvidesIntoSet @Named("urls") String provideFooUrl(FooManager fm) { returm fm.getUrl(); } @ProvidesIntoSet @Named("urls") String provideBarUrl(BarManager bm) { return bm.getUrl(); }
will add two items to the@Named("urls") Set<String>
set. The items are bound as providers and will be evaluated at injection time.- Since:
- 4.0