I want to fetch a bean based on string by using dependency injection. I want to find a way in which I can map strings into beans. I know standard java ways to do that such as using a hash-map but I want to do it the spring way. Here is my main logic:
if workflow key is LOGINWORKFLOW return LOGINWORKFLOW bean. How to achieve this in spring boot?
I don't want to use xml.
Approach:
I can autowire all of the beans in a single class and then add them in a hash map by using the @Postconstruct annotation