Project

General

Profile

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
}
15

    
16

    
17
public class Stakeholder<StringOrTopic> {
18
    @Id
19
    @JsonProperty("_id")
20
    private String id;
21

    
22
    private StakeholderType type; // private StakeholderType type;
23
    private String index_id;
24
    private String index_name;
25
    private String index_shortName;
26
    private String logoUrl;
27
    private String name;
28
    private String alias;
29
    private String description;
30
    private String defaultId = null;
31
    private boolean isActive;
32
    private boolean isPublic;
33
    private Date creationDate;
34
    private Date updateDate;
35
    private List<String> managers;
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
        name = stakeholder.getName();
50
        alias = stakeholder.getAlias();
51
        description = stakeholder.getDescription();
52
        defaultId = stakeholder.getDefaultId();
53
        isActive = stakeholder.getIsActive();
54
        isPublic = stakeholder.getIsPublic();
55
        creationDate = stakeholder.getCreationDate();
56
        updateDate = stakeholder.getUpdateDate();
57
        managers = stakeholder.getManagers();
58
    }
59

    
60
    public String getId() {
61
        return id;
62
    }
63

    
64
    public void setId(String id) {
65
        this.id = id;
66
    }
67

    
68
//    public StakeholderType getType() {
69
//        return type;
70
//    }
71
//
72
//    public void setType(StakeholderType type) {
73
//        this.type = type;
74
//    }
75

    
76
    public String getType() {
77
        if(type == null) {
78
            return null;
79
        }
80
        return type.name();
81
    }
82

    
83
    public void setType(String type) {
84
        if(type == null) {
85
            this.type = null;
86
        } else {
87
            StakeholderType stakeholderType = StakeholderType.valueOf(type);
88
            this.type = stakeholderType;
89
        }
90
    }
91

    
92
    public String getIndex_id() {
93
        return index_id;
94
    }
95

    
96
    public void setIndex_id(String index_id) {
97
        this.index_id = index_id;
98
    }
99

    
100
    public String getIndex_name() {
101
        return index_name;
102
    }
103

    
104
    public void setIndex_name(String index_name) {
105
        this.index_name = index_name;
106
    }
107

    
108
    public String getIndex_shortName() {
109
        return index_shortName;
110
    }
111

    
112
    public void setIndex_shortName(String index_shortName) {
113
        this.index_shortName = index_shortName;
114
    }
115

    
116
    public String getLogoUrl() {
117
        return logoUrl;
118
    }
119

    
120
    public void setLogoUrl(String logoUrl) {
121
        this.logoUrl = logoUrl;
122
    }
123

    
124
    public String getName() { return name; }
125

    
126
    public void setName(String name) { this.name = name; }
127
    
128
    public String getAlias() {
129
        return alias;
130
    }
131

    
132
    public void setAlias(String alias) {
133
        this.alias = alias;
134
    }
135

    
136
    public String getDescription() {
137
        return description;
138
    }
139

    
140
    public void setDescription(String description) {
141
        this.description = description;
142
    }
143

    
144
    public String getDefaultId() {
145
        return defaultId;
146
    }
147

    
148
    public void setDefaultId(String defaultId) {
149
        this.defaultId = defaultId;
150
    }
151

    
152
    public boolean getIsActive() {
153
        return isActive;
154
    }
155

    
156
    public void setIsActive(boolean isActive) {
157
        this.isActive = isActive;
158
    }
159

    
160
    public boolean getIsPublic() {
161
        return isPublic;
162
    }
163

    
164
    public void setIsPublic(boolean isPublic) {
165
        this.isPublic = isPublic;
166
    }
167

    
168
    public Date getCreationDate() {
169
        return creationDate;
170
    }
171

    
172
    public void setCreationDate(Date creationDate) {
173
        this.creationDate = creationDate;
174
    }
175

    
176
    public Date getUpdateDate() {
177
        return updateDate;
178
    }
179

    
180
    public void setUpdateDate(Date updateDate) {
181
        this.updateDate = updateDate;
182
    }
183

    
184
    public List<String> getManagers() {
185
        return managers;
186
    }
187

    
188
    public void setManagers(List<String> managers) {
189
        this.managers = managers;
190
    }
191

    
192
    public List<StringOrTopic> getTopics() {
193
        return topics;
194
    }
195

    
196
    public void setTopics(List<StringOrTopic> topics) {
197
        this.topics = topics;
198
    }
199
}
(5-5/7)