1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.ibatis.submitted.extends_with_constructor;
17
18 import java.util.LinkedList;
19 import java.util.List;
20
21 public class StudentConstructor {
22 public enum Constructor {
23 ID, ID_NAME
24 }
25
26 private List<Constructor> constructors = new LinkedList<>();
27 private final int id;
28 private String name;
29 private Teacher teacher;
30
31 public StudentConstructor(Integer id) {
32 constructors.add(Constructor.ID);
33 this.id = id;
34 }
35
36 public StudentConstructor(Integer id, String name) {
37 constructors.add(Constructor.ID_NAME);
38 this.id = id;
39 this.name = name;
40 }
41
42 public int getId() {
43 return id;
44 }
45
46 public String getName() {
47 return name;
48 }
49
50 public void setName(String name) {
51 this.name = name;
52 }
53
54 public Teacher getTeacher() {
55 return teacher;
56 }
57
58 public void setTeacher(Teacher teacher) {
59 this.teacher = teacher;
60 }
61
62 public List<Constructor> getConstructors() {
63 return constructors;
64 }
65 }