How do I return an arbitrary number of @Bean objects of the same type through a @Configuration class? Something like:
@Configuration
public class MyClass {
@Bean
public MyBean myBean {
for (String myBeanName: getMyBeanNames()) {
MyBean myBean = new MyBean();
myBean.setName(myBeanName);
return myBean
}
}
Obviously the snippet won't compile, but how would I achieve the result?