Maybe filter was not the best choice of a name. So don't let yourself be
tricket by this. At the end the interface method is:
List getUsers(List users);
And the concrete implementation is absolutely free to add, remove or replace
users from the list.
Am 7. Februar 2015 18:10:14 MEZ, schrieb "A
Hello,
Am 07.02.2015 um 18:10 schrieb Aurélien:
> Yes exactly: I want a chain like behavior where the order of the modules in
> the createInjector method determines the order in the chain.
Then maybe a solution I developed some time ago helps you:
http://stackoverflow.com/a/7544939/396730
It do
Yes exactly: I want a chain like behavior where the order of the modules in
the createInjector method determines the order in the chain.
However, I think the Multibinder Set binder does preserve the ordering.
Indeed, Multibinder is using an ImmutableSet which preserves the order from
constructio
So what you want is a chain like behavior where the order of the modules
in the createInjector method determines the order in the chain.
I don't think this is easily possible with the current guice extensions.
Multibinder offers a Set and a Map binder. Neither of them preserves the
ordering.
Y
Thank you for your responses.
The OptionalBinder lead me to what I want : a plugin-type architecture.
I could not reference a parent implementation with OptionalBinder.
However, the Multibinder enable to add multiple implementations and to
reference all these implementations.
Although the Multib
One thing that will not work is injecting A into either ASub or AOtherSub.
Because this will create an endless loop sinc A is bound to ASub resp.
AOtherSub.
You need to be more specific and either request ACore or introduce a name for
the parent so you could inject (@Parent A)
Am 4. Februar 201
If I am understanding your use case correctly, it sounds like you may be
interested in using the OptionalBinder that is new in guice4. It would
allow you to set up a default binding (setDefault) in core, and then
override that in a sub (setBinding).
The javadoc is fairly thorough and has some e
Hi,
I have a peculiar use case:
- I have 3 libraries, Core, Sub and OtherSub
- Sub and OtherSub do not know anything about each other, but they know the
existence of Core
- Sub and OtherSub override the same functionality in Core
- In a project, I want to combine Sub and OtherSub.
It does not wo