interoperate between primitive and boxed values in injector
realityforge opened this issue · comments
As of v0.05
if a component requests a value of type int
and a value of type java.lang.Integer
then they are considered different service requests. We could refactor the internals of Sting to treat them identically. This would make it possible to provide a configuration value (i.e. @Named("server.port") int getPort() { return 8080; }
) that could be consumed optionally (i.e. @Named("server.port") @Nullable Integer serverPort
) or added to a collection etc.
This should not be hard to implement but would require a lot more tests.