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.Date;
|
7
|
import java.util.List;
|
8
|
|
9
|
|
10
|
enum StakeholderType
|
11
|
{
|
12
|
// Do not rename or remove existring values. This may cause problems with already stored values in DB
|
13
|
funder, ri, project, organization,
|
14
|
FUNDER, RI, PROJECT, ORGANIZATION;
|
15
|
}
|
16
|
|
17
|
|
18
|
public class Stakeholder<StringOrTopic> {
|
19
|
@Id
|
20
|
@JsonProperty("_id")
|
21
|
private String id;
|
22
|
|
23
|
private StakeholderType type; // private StakeholderType type;
|
24
|
private String index_id;
|
25
|
private String index_name;
|
26
|
private String index_shortName;
|
27
|
private String logoUrl;
|
28
|
private boolean isUpload = false;
|
29
|
private String name;
|
30
|
private String alias;
|
31
|
private String description;
|
32
|
private String defaultId = null;
|
33
|
private Visibility visibility = Visibility.PRIVATE;
|
34
|
private Date creationDate;
|
35
|
private Date updateDate;
|
36
|
|
37
|
private List<StringOrTopic> topics;
|
38
|
|
39
|
public Stakeholder() {
|
40
|
|
41
|
}
|
42
|
public Stakeholder(Stakeholder stakeholder) {
|
43
|
id = stakeholder.getId();
|
44
|
setType(stakeholder.getType());
|
45
|
index_id = stakeholder.getIndex_id();
|
46
|
index_name = stakeholder.getIndex_name();
|
47
|
index_shortName = stakeholder.getIndex_shortName();
|
48
|
logoUrl = stakeholder.getLogoUrl();
|
49
|
isUpload = stakeholder.getIsUpload();
|
50
|
name = stakeholder.getName();
|
51
|
alias = stakeholder.getAlias();
|
52
|
description = stakeholder.getDescription();
|
53
|
defaultId = stakeholder.getDefaultId();
|
54
|
setVisibility(stakeholder.getVisibility());
|
55
|
creationDate = stakeholder.getCreationDate();
|
56
|
updateDate = stakeholder.getUpdateDate();
|
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 StakeholderType getType() {
|
68
|
// return type;
|
69
|
// }
|
70
|
//
|
71
|
// public void setType(StakeholderType type) {
|
72
|
// this.type = type;
|
73
|
// }
|
74
|
|
75
|
public String getType() {
|
76
|
if(type == null) {
|
77
|
return null;
|
78
|
}
|
79
|
return type.name();
|
80
|
}
|
81
|
|
82
|
public void setType(String type) {
|
83
|
if(type == null) {
|
84
|
this.type = null;
|
85
|
} else {
|
86
|
StakeholderType stakeholderType = StakeholderType.valueOf(type);
|
87
|
this.type = stakeholderType;
|
88
|
}
|
89
|
}
|
90
|
|
91
|
public String getIndex_id() {
|
92
|
return index_id;
|
93
|
}
|
94
|
|
95
|
public void setIndex_id(String index_id) {
|
96
|
this.index_id = index_id;
|
97
|
}
|
98
|
|
99
|
public String getIndex_name() {
|
100
|
return index_name;
|
101
|
}
|
102
|
|
103
|
public void setIndex_name(String index_name) {
|
104
|
this.index_name = index_name;
|
105
|
}
|
106
|
|
107
|
public String getIndex_shortName() {
|
108
|
return index_shortName;
|
109
|
}
|
110
|
|
111
|
public void setIndex_shortName(String index_shortName) {
|
112
|
this.index_shortName = index_shortName;
|
113
|
}
|
114
|
|
115
|
public String getLogoUrl() {
|
116
|
return logoUrl;
|
117
|
}
|
118
|
|
119
|
public void setLogoUrl(String logoUrl) {
|
120
|
this.logoUrl = logoUrl;
|
121
|
}
|
122
|
|
123
|
public boolean getIsUpload() {
|
124
|
return isUpload;
|
125
|
}
|
126
|
|
127
|
public void setIsUpload(boolean isUpload) {
|
128
|
this.isUpload = isUpload;
|
129
|
}
|
130
|
|
131
|
public String getName() { return name; }
|
132
|
|
133
|
public void setName(String name) { this.name = name; }
|
134
|
|
135
|
public String getAlias() {
|
136
|
return alias;
|
137
|
}
|
138
|
|
139
|
public void setAlias(String alias) {
|
140
|
this.alias = alias;
|
141
|
}
|
142
|
|
143
|
public String getDescription() {
|
144
|
return description;
|
145
|
}
|
146
|
|
147
|
public void setDescription(String description) {
|
148
|
this.description = description;
|
149
|
}
|
150
|
|
151
|
public String getDefaultId() {
|
152
|
return defaultId;
|
153
|
}
|
154
|
|
155
|
public void setDefaultId(String defaultId) {
|
156
|
this.defaultId = defaultId;
|
157
|
}
|
158
|
|
159
|
public Visibility getVisibility() {
|
160
|
//return visibility.getLabel();
|
161
|
return visibility;
|
162
|
}
|
163
|
|
164
|
public void setVisibility(Visibility visibility) {
|
165
|
//this.visibility = Visibility.get(visibility);
|
166
|
this.visibility = visibility;
|
167
|
}
|
168
|
|
169
|
public Date getCreationDate() {
|
170
|
return creationDate;
|
171
|
}
|
172
|
|
173
|
public void setCreationDate(Date creationDate) {
|
174
|
this.creationDate = creationDate;
|
175
|
}
|
176
|
|
177
|
public Date getUpdateDate() {
|
178
|
return updateDate;
|
179
|
}
|
180
|
|
181
|
public void setUpdateDate(Date updateDate) {
|
182
|
this.updateDate = updateDate;
|
183
|
}
|
184
|
|
185
|
public List<StringOrTopic> getTopics() {
|
186
|
return topics;
|
187
|
}
|
188
|
|
189
|
public void setTopics(List<StringOrTopic> topics) {
|
190
|
this.topics = topics;
|
191
|
}
|
192
|
}
|