1
|
package eu.dnetlib.uoamonitorservice.entities;
|
2
|
|
3
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
4
|
import org.springframework.data.annotation.Id;
|
5
|
|
6
|
import java.util.List;
|
7
|
|
8
|
enum SectionType {
|
9
|
// Do not rename or remove existring values. This may cause problems with already stored values in DB
|
10
|
number, chart;
|
11
|
}
|
12
|
|
13
|
public class Section<StringOrIndicator> {
|
14
|
@Id
|
15
|
@JsonProperty("_id")
|
16
|
private String id;
|
17
|
|
18
|
private String title;
|
19
|
private String defaultId;
|
20
|
private String stakeholderAlias;
|
21
|
private SectionType type;
|
22
|
private List<StringOrIndicator> indicators;
|
23
|
|
24
|
public Section() {}
|
25
|
|
26
|
public Section(Section section) {
|
27
|
id = section.getId();
|
28
|
title = section.getTitle();
|
29
|
defaultId = section.getDefaultId();
|
30
|
stakeholderAlias = section.getStakeholderAlias();
|
31
|
setType(section.getType());
|
32
|
}
|
33
|
|
34
|
public void copyFromDefault(Section defaultSection) {
|
35
|
setTitle(defaultSection.getTitle());
|
36
|
setType(defaultSection.getType());
|
37
|
setDefaultId(defaultSection.id);
|
38
|
}
|
39
|
|
40
|
public String getId() {
|
41
|
return id;
|
42
|
}
|
43
|
|
44
|
public void setId(String id) {
|
45
|
this.id = id;
|
46
|
}
|
47
|
|
48
|
public String getTitle() {
|
49
|
return title;
|
50
|
}
|
51
|
|
52
|
public void setTitle(String title) {
|
53
|
this.title = title;
|
54
|
}
|
55
|
|
56
|
public String getDefaultId() {
|
57
|
return defaultId;
|
58
|
}
|
59
|
|
60
|
public void setDefaultId(String defaultId) {
|
61
|
this.defaultId = defaultId;
|
62
|
}
|
63
|
|
64
|
public String getStakeholderAlias() {
|
65
|
return stakeholderAlias;
|
66
|
}
|
67
|
|
68
|
public void setStakeholderAlias(String stakeholderAlias) {
|
69
|
this.stakeholderAlias = stakeholderAlias;
|
70
|
}
|
71
|
|
72
|
public String getType() {
|
73
|
if(type == null) {
|
74
|
return null;
|
75
|
}
|
76
|
return type.name();
|
77
|
}
|
78
|
|
79
|
public void setType(String type) {
|
80
|
if(type == null) {
|
81
|
this.type = null;
|
82
|
} else {
|
83
|
SectionType sectionType = SectionType.valueOf(type);
|
84
|
this.type = sectionType;
|
85
|
}
|
86
|
}
|
87
|
|
88
|
public List<StringOrIndicator> getIndicators() {
|
89
|
return indicators;
|
90
|
}
|
91
|
|
92
|
public void setIndicators(List<StringOrIndicator> indicators) {
|
93
|
this.indicators = indicators;
|
94
|
}
|
95
|
}
|