1 |
57503
|
konstantin
|
package eu.dnetlib.uoamonitorservice.entities;
|
2 |
|
|
|
3 |
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
4 |
|
|
import org.springframework.data.annotation.Id;
|
5 |
|
|
|
6 |
57923
|
konstantin
|
import java.util.ArrayList;
|
7 |
57503
|
konstantin
|
import java.util.List;
|
8 |
|
|
|
9 |
|
|
enum IndicatorType {
|
10 |
|
|
// Do not rename or remove existring values. This may cause problems with already stored values in DB
|
11 |
|
|
number, chart;
|
12 |
|
|
}
|
13 |
|
|
|
14 |
|
|
enum IndicatorWidth {
|
15 |
|
|
// Do not rename or remove existring values. This may cause problems with already stored values in DB
|
16 |
|
|
small, medium, large;
|
17 |
|
|
}
|
18 |
|
|
|
19 |
|
|
public class Indicator {
|
20 |
|
|
@Id
|
21 |
|
|
@JsonProperty("_id")
|
22 |
|
|
private String id;
|
23 |
|
|
|
24 |
|
|
private String name;
|
25 |
|
|
private String description;
|
26 |
|
|
private IndicatorType type; //number,chart
|
27 |
|
|
private IndicatorWidth width; //small,medium,large
|
28 |
57923
|
konstantin
|
private List<String> tags; // this field is not used anywhere now
|
29 |
57503
|
konstantin
|
private boolean isActive;
|
30 |
|
|
private boolean isPublic;
|
31 |
57923
|
konstantin
|
private String defaultId;
|
32 |
57503
|
konstantin
|
private List<IndicatorPath> indicatorPaths;
|
33 |
|
|
|
34 |
57923
|
konstantin
|
public void copyFromDefault(Indicator defaultIndicator) {
|
35 |
|
|
setName(defaultIndicator.getName());
|
36 |
|
|
setDescription(defaultIndicator.getDescription());
|
37 |
57924
|
konstantin
|
setType(defaultIndicator.getType());
|
38 |
57923
|
konstantin
|
setWidth(defaultIndicator.getWidth());
|
39 |
|
|
setTags(defaultIndicator.getTags());
|
40 |
|
|
setIsActive(false);
|
41 |
|
|
setIsPublic(false);
|
42 |
|
|
setDefaultId(defaultIndicator.id);
|
43 |
|
|
setIndicatorPaths(defaultIndicator.getIndicatorPaths());
|
44 |
|
|
}
|
45 |
|
|
|
46 |
57503
|
konstantin
|
public String getId() {
|
47 |
|
|
return id;
|
48 |
|
|
}
|
49 |
|
|
|
50 |
|
|
public void setId(String id) {
|
51 |
|
|
this.id = id;
|
52 |
|
|
}
|
53 |
|
|
|
54 |
|
|
public String getName() {
|
55 |
|
|
return name;
|
56 |
|
|
}
|
57 |
|
|
|
58 |
|
|
public void setName(String name) {
|
59 |
|
|
this.name = name;
|
60 |
|
|
}
|
61 |
|
|
|
62 |
|
|
public String getDescription() {
|
63 |
|
|
return description;
|
64 |
|
|
}
|
65 |
|
|
|
66 |
|
|
public void setDescription(String description) {
|
67 |
|
|
this.description = description;
|
68 |
|
|
}
|
69 |
|
|
|
70 |
57671
|
konstantin
|
public String getType() {
|
71 |
57923
|
konstantin
|
if(type == null) {
|
72 |
|
|
return null;
|
73 |
|
|
}
|
74 |
57671
|
konstantin
|
return type.name();
|
75 |
57503
|
konstantin
|
}
|
76 |
|
|
|
77 |
57923
|
konstantin
|
// public String getStringType() {
|
78 |
|
|
// return type.name();
|
79 |
|
|
// }
|
80 |
|
|
|
81 |
|
|
// public void setType(IndicatorType type) {
|
82 |
|
|
// this.type = type;
|
83 |
|
|
// }
|
84 |
|
|
public void setType(String type) {
|
85 |
|
|
if(type == null) {
|
86 |
|
|
this.type = null;
|
87 |
|
|
} else {
|
88 |
|
|
IndicatorType indicatorType = IndicatorType.valueOf(type);
|
89 |
|
|
this.type = indicatorType;
|
90 |
|
|
}
|
91 |
57503
|
konstantin
|
}
|
92 |
|
|
|
93 |
|
|
public IndicatorWidth getWidth() {
|
94 |
|
|
return width;
|
95 |
|
|
}
|
96 |
|
|
|
97 |
|
|
public void setWidth(IndicatorWidth width) {
|
98 |
|
|
this.width = width;
|
99 |
|
|
}
|
100 |
|
|
|
101 |
|
|
public List<String> getTags() {
|
102 |
|
|
return tags;
|
103 |
|
|
}
|
104 |
|
|
|
105 |
|
|
public void setTags(List<String> tags) {
|
106 |
|
|
this.tags = tags;
|
107 |
|
|
}
|
108 |
|
|
|
109 |
57578
|
konstantin
|
public boolean getIsActive() {
|
110 |
57503
|
konstantin
|
return isActive;
|
111 |
|
|
}
|
112 |
|
|
|
113 |
57578
|
konstantin
|
public void setIsActive(boolean isActive) {
|
114 |
57503
|
konstantin
|
this.isActive = isActive;
|
115 |
|
|
}
|
116 |
|
|
|
117 |
57578
|
konstantin
|
public boolean getIsPublic() {
|
118 |
57503
|
konstantin
|
return isPublic;
|
119 |
|
|
}
|
120 |
|
|
|
121 |
57578
|
konstantin
|
public void setIsPublic(boolean isPublic) {
|
122 |
57503
|
konstantin
|
this.isPublic = isPublic;
|
123 |
|
|
}
|
124 |
|
|
|
125 |
57923
|
konstantin
|
public String getDefaultId() {
|
126 |
|
|
return defaultId;
|
127 |
57637
|
konstantin
|
}
|
128 |
|
|
|
129 |
57923
|
konstantin
|
public void setDefaultId(String defaultId) {
|
130 |
|
|
this.defaultId = defaultId;
|
131 |
57637
|
konstantin
|
}
|
132 |
|
|
|
133 |
57578
|
konstantin
|
public List<IndicatorPath> getIndicatorPaths() {
|
134 |
57503
|
konstantin
|
return indicatorPaths;
|
135 |
|
|
}
|
136 |
|
|
|
137 |
57578
|
konstantin
|
public void setIndicatorPaths(List<IndicatorPath> indicatorPaths) {
|
138 |
|
|
this.indicatorPaths = indicatorPaths;
|
139 |
57503
|
konstantin
|
}
|
140 |
57578
|
konstantin
|
|
141 |
57671
|
konstantin
|
// public String hasType() {
|
142 |
|
|
// return this.type.name();
|
143 |
|
|
// }
|
144 |
57503
|
konstantin
|
}
|