139 lines
3.7 KiB
Java
139 lines
3.7 KiB
Java
package eu.dnetlib.uoamonitorservice.entities;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
import eu.dnetlib.uoamonitorservice.generics.Common;
|
|
import eu.dnetlib.uoamonitorservice.primitives.IndicatorPath;
|
|
import eu.dnetlib.uoamonitorservice.primitives.IndicatorSize;
|
|
import eu.dnetlib.uoamonitorservice.primitives.IndicatorType;
|
|
import eu.dnetlib.uoamonitorservice.primitives.Visibility;
|
|
import org.springframework.data.annotation.CreatedDate;
|
|
import org.springframework.data.annotation.Id;
|
|
import org.springframework.data.annotation.LastModifiedDate;
|
|
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
|
|
public class Indicator extends Common {
|
|
@Id
|
|
@JsonProperty("_id")
|
|
private String id;
|
|
private String additionalDescription;
|
|
private IndicatorType type; //number,chart
|
|
private IndicatorSize width; //small,medium,large
|
|
private IndicatorSize height = IndicatorSize.MEDIUM; //small,medium,large
|
|
private List<String> tags; // this field is not used anywhere now
|
|
@CreatedDate
|
|
private Date creationDate;
|
|
@LastModifiedDate
|
|
private Date updateDate;
|
|
private String defaultId;
|
|
private List<IndicatorPath> indicatorPaths;
|
|
|
|
public void copyFromDefault(Indicator defaultIndicator, Visibility visibility) {
|
|
setName(defaultIndicator.getName());
|
|
setDescription(defaultIndicator.getDescription());
|
|
setAdditionalDescription(defaultIndicator.getAdditionalDescription());
|
|
setType(defaultIndicator.getType());
|
|
setWidth(defaultIndicator.getWidth());
|
|
setHeight(defaultIndicator.getHeight());
|
|
setTags(defaultIndicator.getTags());
|
|
setVisibility(visibility);
|
|
setCreationDate(defaultIndicator.getCreationDate());
|
|
setUpdateDate(defaultIndicator.getUpdateDate());
|
|
setDefaultId(defaultIndicator.getId());
|
|
setIndicatorPaths(defaultIndicator.getIndicatorPaths());
|
|
}
|
|
|
|
public String getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(String id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getAdditionalDescription() {
|
|
return additionalDescription;
|
|
}
|
|
|
|
public void setAdditionalDescription(String description) {
|
|
this.additionalDescription = description;
|
|
}
|
|
|
|
public String getType() {
|
|
if(type == null) {
|
|
return null;
|
|
}
|
|
return type.name();
|
|
}
|
|
|
|
public void setType(String type) {
|
|
if(type == null) {
|
|
this.type = null;
|
|
} else {
|
|
IndicatorType indicatorType = IndicatorType.valueOf(type);
|
|
this.type = indicatorType;
|
|
}
|
|
}
|
|
|
|
public IndicatorSize getWidth() {
|
|
return width;
|
|
}
|
|
|
|
public void setWidth(IndicatorSize width) {
|
|
this.width = width;
|
|
}
|
|
|
|
public IndicatorSize getHeight() {
|
|
return height;
|
|
}
|
|
|
|
public void setHeight(IndicatorSize height) {
|
|
this.height = height;
|
|
}
|
|
|
|
public List<String> getTags() {
|
|
return tags;
|
|
}
|
|
|
|
public void setTags(List<String> tags) {
|
|
this.tags = tags;
|
|
}
|
|
|
|
public Date getCreationDate() {
|
|
return creationDate;
|
|
}
|
|
|
|
public void setCreationDate(Date creationDate) {
|
|
this.creationDate = creationDate;
|
|
}
|
|
|
|
public Date getUpdateDate() {
|
|
return updateDate;
|
|
}
|
|
|
|
public void setUpdateDate(Date updateDate) {
|
|
this.updateDate = updateDate;
|
|
}
|
|
|
|
public String getDefaultId() {
|
|
return defaultId;
|
|
}
|
|
|
|
public void setDefaultId(String defaultId) {
|
|
this.defaultId = defaultId;
|
|
}
|
|
|
|
public List<IndicatorPath> getIndicatorPaths() {
|
|
return indicatorPaths;
|
|
}
|
|
|
|
public void setIndicatorPaths(List<IndicatorPath> indicatorPaths) {
|
|
this.indicatorPaths = indicatorPaths;
|
|
}
|
|
|
|
// public String hasType() {
|
|
// return this.type.name();
|
|
// }
|
|
}
|