This commit is contained in:
mherbaghinyan 2018-05-22 17:07:08 +04:00
parent a6655de20c
commit fa60d4e69e
2 changed files with 8 additions and 0 deletions

View File

@ -1,7 +1,9 @@
package com.baeldung.collection;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import java.util.*;
@ -28,16 +30,20 @@ public class CollectionConfig {
}
@Bean
@Qualifier("CollectionsBean")
@Order(2)
public BaeldungBean getElement() {
return new BaeldungBean();
}
@Bean
@Order(3)
public BaeldungBean getAnotherElement() {
return new BaeldungBean();
}
@Bean
@Order(1)
public BaeldungBean getOneMoreElement() {
return new BaeldungBean();
}

View File

@ -1,6 +1,7 @@
package com.baeldung.collection;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import java.util.List;
import java.util.Map;
@ -19,6 +20,7 @@ public class CollectionsBean {
private Map<Integer, String> nameMap;
@Autowired
@Qualifier("CollectionsBean")
private List<BaeldungBean> beanList;
public CollectionsBean() {