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 defaultId = null;
30
    private boolean isActive;
31
    private boolean isPublic;
32
    private Date creationDate;
33
    private Date updateDate;
34
    private List<String> managers;
35

    
36
    private List<StringOrTopic> topics;
37

    
38
    public Stakeholder() {
39

    
40
    }
41
    public Stakeholder(Stakeholder stakeholder) {
42
        id = stakeholder.getId();
43
        setType(stakeholder.getType());
44
        index_id = stakeholder.getIndex_id();
45
        index_name = stakeholder.getIndex_name();
46
        index_shortName = stakeholder.getIndex_shortName();
47
        logoUrl = stakeholder.getLogoUrl();
48
        name = stakeholder.getName();
49
        alias = stakeholder.getAlias();
50
        defaultId = stakeholder.getDefaultId();
51
        isActive = stakeholder.getIsActive();
52
        isPublic = stakeholder.getIsPublic();
53
        creationDate = stakeholder.getCreationDate();
54
        updateDate = stakeholder.getUpdateDate();
55
        managers = stakeholder.getManagers();
56
    }
57

    
58
    public String getId() {
59
        return id;
60
    }
61

    
62
    public void setId(String id) {
63
        this.id = id;
64
    }
65

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

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

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

    
90
    public String getIndex_id() {
91
        return index_id;
92
    }
93

    
94
    public void setIndex_id(String index_id) {
95
        this.index_id = index_id;
96
    }
97

    
98
    public String getIndex_name() {
99
        return index_name;
100
    }
101

    
102
    public void setIndex_name(String index_name) {
103
        this.index_name = index_name;
104
    }
105

    
106
    public String getIndex_shortName() {
107
        return index_shortName;
108
    }
109

    
110
    public void setIndex_shortName(String index_shortName) {
111
        this.index_shortName = index_shortName;
112
    }
113

    
114
    public String getLogoUrl() {
115
        return logoUrl;
116
    }
117

    
118
    public void setLogoUrl(String logoUrl) {
119
        this.logoUrl = logoUrl;
120
    }
121

    
122
    public String getName() { return name; }
123

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

    
130
    public void setAlias(String alias) {
131
        this.alias = alias;
132
    }
133

    
134
    public String getDefaultId() {
135
        return defaultId;
136
    }
137

    
138
    public void setDefaultId(String defaultId) {
139
        this.defaultId = defaultId;
140
    }
141

    
142
    public boolean getIsActive() {
143
        return isActive;
144
    }
145

    
146
    public void setIsActive(boolean isActive) {
147
        this.isActive = isActive;
148
    }
149

    
150
    public boolean getIsPublic() {
151
        return isPublic;
152
    }
153

    
154
    public void setIsPublic(boolean isPublic) {
155
        this.isPublic = isPublic;
156
    }
157

    
158
    public Date getCreationDate() {
159
        return creationDate;
160
    }
161

    
162
    public void setCreationDate(Date creationDate) {
163
        this.creationDate = creationDate;
164
    }
165

    
166
    public Date getUpdateDate() {
167
        return updateDate;
168
    }
169

    
170
    public void setUpdateDate(Date updateDate) {
171
        this.updateDate = updateDate;
172
    }
173

    
174
    public List<String> getManagers() {
175
        return managers;
176
    }
177

    
178
    public void setManagers(List<String> managers) {
179
        this.managers = managers;
180
    }
181

    
182
    public List<StringOrTopic> getTopics() {
183
        return topics;
184
    }
185

    
186
    public void setTopics(List<StringOrTopic> topics) {
187
        this.topics = topics;
188
    }
189
}
(5-5/7)