I have a similar question here
Guice with multiple concretes......picking one of them
with a solution for Guice.
But I have a different project usin
Something like this should work. This uses @Autowired and not xml configuration:
@org.springframework.stereotype.Service
public class OrderProcessorImpl implements OrderProcessorInterface {
private List shipperProviders;
private Map shipperProvidersMap = new HashMap<>();
@Autowired
public void setShipperProviders(List shipperProviders) {
this.shipperProviders= shipperProviders;
this.shipperProviders.stream().forEach(p->shipperProvidersMap .put(/* your code for getting the key */, p));
}
Gradle dependency hint:
compile group: 'org.springframework', name: 'spring-context', version: '5.1.9.RELEASE'