set bean names
This commit is contained in:
parent
fa60d4e69e
commit
834be9a720
|
@ -4,4 +4,15 @@ package com.baeldung.collection;
|
|||
* Created by Gebruiker on 5/22/2018.
|
||||
*/
|
||||
public class BaeldungBean {
|
||||
|
||||
private String name;
|
||||
|
||||
public BaeldungBean(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,18 +33,18 @@ public class CollectionConfig {
|
|||
@Qualifier("CollectionsBean")
|
||||
@Order(2)
|
||||
public BaeldungBean getElement() {
|
||||
return new BaeldungBean();
|
||||
return new BaeldungBean("John");
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Order(3)
|
||||
public BaeldungBean getAnotherElement() {
|
||||
return new BaeldungBean();
|
||||
return new BaeldungBean("Adam");
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Order(1)
|
||||
public BaeldungBean getOneMoreElement() {
|
||||
return new BaeldungBean();
|
||||
return new BaeldungBean("Harry");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue