|
@@ -1,19 +1,55 @@
|
1
|
1
|
package com.example.demo;
|
2
|
2
|
|
3
|
3
|
import com.sun.tools.javac.util.List;
|
|
4
|
+import org.springframework.beans.factory.annotation.Qualifier;
|
4
|
5
|
import org.springframework.context.annotation.Bean;
|
5
|
6
|
import org.springframework.context.annotation.Configuration;
|
|
7
|
+import org.springframework.stereotype.Component;
|
|
8
|
+
|
|
9
|
+import java.util.ArrayList;
|
6
|
10
|
|
7
|
11
|
@Configuration
|
8
|
12
|
public class StudentConfig {
|
9
|
13
|
|
10
|
14
|
@Bean(name = "students")
|
|
15
|
+ //@Qualifier("currentStudents")
|
11
|
16
|
public Students currentStudents(){
|
12
|
|
- return new Students();
|
|
17
|
+ ArrayList<Student> currentStudents = new ArrayList<>();
|
|
18
|
+
|
|
19
|
+ currentStudents.add(new Student(1, "Ned Redmond"));
|
|
20
|
+ currentStudents.add(new Student(2, "Seth Abrams"));
|
|
21
|
+ currentStudents.add(new Student(3, "Akeem Cherry"));
|
|
22
|
+ currentStudents.add(new Student(4, "Whitney Martinez"));
|
|
23
|
+ currentStudents.add(new Student(5, "Nira Parikh"));
|
|
24
|
+ currentStudents.add(new Student(6, "Connor Dunnigan"));
|
|
25
|
+ currentStudents.add(new Student(7, "Christian Sheridan"));
|
|
26
|
+ currentStudents.add(new Student(8, "Curtis Cook"));
|
|
27
|
+ currentStudents.add(new Student(9, "Nuridalia Hernandez"));
|
|
28
|
+ currentStudents.add(new Student(10, "Brandon DeFrancis"));
|
|
29
|
+
|
|
30
|
+ return new Students(currentStudents);
|
13
|
31
|
}
|
14
|
32
|
|
15
|
|
- @Bean
|
|
33
|
+ @Bean(name = "previousStudents")
|
|
34
|
+ //@Qualifier("previousStudents")
|
16
|
35
|
public Students previousStudents(){
|
17
|
|
- return new Students();
|
|
36
|
+ ArrayList<Student> previousStudents = new ArrayList<>();
|
|
37
|
+
|
|
38
|
+ previousStudents.add(new Student(1, "OldNed Redmond"));
|
|
39
|
+ previousStudents.add(new Student(2, "OldSeth Abrams"));
|
|
40
|
+ previousStudents.add(new Student(3, "OldAkeem Cherry"));
|
|
41
|
+ previousStudents.add(new Student(4, "OldWhitney Martinez"));
|
|
42
|
+ previousStudents.add(new Student(5, "OldNira Parikh"));
|
|
43
|
+ previousStudents.add(new Student(6, "OldConnor Dunnigan"));
|
|
44
|
+ previousStudents.add(new Student(7, "OldChristian Sheridan"));
|
|
45
|
+ previousStudents.add(new Student(8, "OldCurtis Cook"));
|
|
46
|
+ previousStudents.add(new Student(9, "OldNuridalia Hernandez"));
|
|
47
|
+ previousStudents.add(new Student(10, "OldBrandon DeFrancis"));
|
|
48
|
+
|
|
49
|
+ return new Students(previousStudents);
|
|
50
|
+
|
18
|
51
|
}
|
|
52
|
+
|
|
53
|
+
|
19
|
54
|
}
|
|
55
|
+
|