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.ArrayList;
|
7
|
import java.util.Date;
|
8
|
import java.util.List;
|
9
|
|
10
|
public class SubCategory<StringOrSection> {
|
11
|
@Id
|
12
|
@JsonProperty("_id")
|
13
|
private String id;
|
14
|
|
15
|
private String name;
|
16
|
private String alias;
|
17
|
private String description;
|
18
|
private Visibility visibility = Visibility.PRIVATE;
|
19
|
private Date creationDate;
|
20
|
private Date updateDate;
|
21
|
private String defaultId;
|
22
|
private List<StringOrSection> charts;
|
23
|
private List<StringOrSection> numbers;
|
24
|
|
25
|
public SubCategory() {}
|
26
|
public SubCategory(SubCategory subCategory) {
|
27
|
id = subCategory.getId();
|
28
|
name = subCategory.getName();
|
29
|
alias = subCategory.getAlias();
|
30
|
description = subCategory.getDescription();
|
31
|
setVisibility(subCategory.getVisibility());
|
32
|
creationDate = subCategory.getCreationDate();
|
33
|
updateDate = subCategory.getUpdateDate();
|
34
|
defaultId = subCategory.getDefaultId();
|
35
|
}
|
36
|
|
37
|
public void createOverviewSubCategory(Category category) {
|
38
|
setName("Overview");
|
39
|
setAlias("overview");
|
40
|
setVisibility(category.getVisibility());
|
41
|
setCreationDate(category.getCreationDate());
|
42
|
setUpdateDate(category.getUpdateDate());
|
43
|
setCharts(new ArrayList<>());
|
44
|
setNumbers(new ArrayList<>());
|
45
|
}
|
46
|
|
47
|
public void copyFromDefault(SubCategory defaultSubCategory) {
|
48
|
setName(defaultSubCategory.getName());
|
49
|
setAlias(defaultSubCategory.getAlias());
|
50
|
setDescription(defaultSubCategory.getDescription());
|
51
|
setVisibility(defaultSubCategory.getVisibility());
|
52
|
setCreationDate(defaultSubCategory.getCreationDate());
|
53
|
setUpdateDate(defaultSubCategory.getUpdateDate());
|
54
|
setDefaultId(defaultSubCategory.getId());
|
55
|
setCharts(new ArrayList());
|
56
|
setNumbers(new ArrayList());
|
57
|
}
|
58
|
|
59
|
public String getId() {
|
60
|
return id;
|
61
|
}
|
62
|
|
63
|
public void setId(String id) {
|
64
|
this.id = id;
|
65
|
}
|
66
|
|
67
|
public String getName() {
|
68
|
return name;
|
69
|
}
|
70
|
|
71
|
public void setName(String name) {
|
72
|
this.name = name;
|
73
|
}
|
74
|
|
75
|
public String getAlias() {
|
76
|
return alias;
|
77
|
}
|
78
|
|
79
|
public void setAlias(String alias) {
|
80
|
this.alias = alias;
|
81
|
}
|
82
|
|
83
|
public String getDescription() {
|
84
|
return description;
|
85
|
}
|
86
|
|
87
|
public void setDescription(String description) {
|
88
|
this.description = description;
|
89
|
}
|
90
|
|
91
|
public Visibility getVisibility() {
|
92
|
return visibility;
|
93
|
}
|
94
|
|
95
|
public void setVisibility(Visibility visibility) {
|
96
|
this.visibility = visibility;
|
97
|
}
|
98
|
|
99
|
public Date getCreationDate() {
|
100
|
return creationDate;
|
101
|
}
|
102
|
|
103
|
public void setCreationDate(Date creationDate) {
|
104
|
this.creationDate = creationDate;
|
105
|
}
|
106
|
|
107
|
public Date getUpdateDate() {
|
108
|
return updateDate;
|
109
|
}
|
110
|
|
111
|
public void setUpdateDate(Date updateDate) {
|
112
|
this.updateDate = updateDate;
|
113
|
}
|
114
|
|
115
|
public String getDefaultId() {
|
116
|
return defaultId;
|
117
|
}
|
118
|
|
119
|
public void setDefaultId(String defaultId) {
|
120
|
this.defaultId = defaultId;
|
121
|
}
|
122
|
|
123
|
public List<StringOrSection> getCharts() {
|
124
|
return charts;
|
125
|
}
|
126
|
|
127
|
public void setCharts(List<StringOrSection> charts) {
|
128
|
this.charts = charts;
|
129
|
}
|
130
|
|
131
|
public List<StringOrSection> getNumbers() {
|
132
|
return numbers;
|
133
|
}
|
134
|
|
135
|
public void setNumbers(List<StringOrSection> numbers) {
|
136
|
this.numbers = numbers;
|
137
|
}
|
138
|
}
|