Multibindings is what you want.  (imho it should just be part of the core)

On Tue, Apr 26, 2016 at 4:04 AM Pablo perez <[email protected]> wrote:

> up vote
> down votefavorite
> <http://stackoverflow.com/questions/36861866/guice-merge-collection-between-abstractmodules#>
>
> I have a couple modules
>
>  A extends AbstractModule
>
>  B extends AbstractModule
>
> Which are used to provide class C.
>
>  class C {
>
>     @Inject List<Components> components;
>  }
>
> That class C can use A, B or both to be instantiate with a specific
> information.
>
> For now I have a provider on A module
>
>  @Provider
>  List<Components>
>
> Of course I can only have one provider per context, so only A can have it
> so far. But I need on both because everyone generate his own Components.
>
> I´ve been reading about Multibinders
> https://github.com/google/guice/wiki/Multibindings
>
> But I would like to know before go for a guice extension, if the guice
> core provide a mechanism for what I want to do.
>
> Regards.
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-guice" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/google-guice.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-guice/11b91eb4-e823-4ee6-afb3-f2c25acfca5e%40googlegroups.com
> <https://groups.google.com/d/msgid/google-guice/11b91eb4-e823-4ee6-afb3-f2c25acfca5e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-guice/CAO9V1MJQ93FmFLXXezsEo9Dq6-Podz6B%3D1y2gZUCCoaf%3D3PFbA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to