108 lines
3.1 KiB
Java
108 lines
3.1 KiB
Java
package eu.dnetlib.uoamonitorservice.generics;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
import eu.dnetlib.uoamonitorservice.entities.Category;
|
|
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.ArrayList;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
|
|
public class SubCategoryGeneric<StringOrSection> extends Common {
|
|
@Id
|
|
@JsonProperty("_id")
|
|
protected String id;
|
|
@CreatedDate
|
|
protected Date creationDate;
|
|
@LastModifiedDate
|
|
protected Date updateDate;
|
|
protected String defaultId;
|
|
protected List<StringOrSection> charts;
|
|
protected List<StringOrSection> numbers;
|
|
|
|
public SubCategoryGeneric() {}
|
|
public SubCategoryGeneric(SubCategoryGeneric subCategory) {
|
|
id = subCategory.getId();
|
|
name = subCategory.getName();
|
|
alias = subCategory.getAlias();
|
|
description = subCategory.getDescription();
|
|
setVisibility(subCategory.getVisibility());
|
|
creationDate = subCategory.getCreationDate();
|
|
updateDate = subCategory.getUpdateDate();
|
|
defaultId = subCategory.getDefaultId();
|
|
}
|
|
|
|
public void createOverviewSubCategory(Category category) {
|
|
setName("Overview");
|
|
setAlias("overview");
|
|
setVisibility(category.getVisibility());
|
|
setCreationDate(category.getCreationDate());
|
|
setUpdateDate(category.getUpdateDate());
|
|
setCharts(new ArrayList<>());
|
|
setNumbers(new ArrayList<>());
|
|
}
|
|
|
|
public void copyFromDefault(SubCategoryGeneric defaultSubCategory) {
|
|
setName(defaultSubCategory.getName());
|
|
setAlias(defaultSubCategory.getAlias());
|
|
setDescription(defaultSubCategory.getDescription());
|
|
setVisibility(defaultSubCategory.getVisibility());
|
|
setCreationDate(defaultSubCategory.getCreationDate());
|
|
setUpdateDate(defaultSubCategory.getUpdateDate());
|
|
setDefaultId(defaultSubCategory.getId());
|
|
setCharts(new ArrayList());
|
|
setNumbers(new ArrayList());
|
|
}
|
|
|
|
public String getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(String id) {
|
|
this.id = id;
|
|
}
|
|
|
|
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<StringOrSection> getCharts() {
|
|
return charts;
|
|
}
|
|
|
|
public void setCharts(List<StringOrSection> charts) {
|
|
this.charts = charts;
|
|
}
|
|
|
|
public List<StringOrSection> getNumbers() {
|
|
return numbers;
|
|
}
|
|
|
|
public void setNumbers(List<StringOrSection> numbers) {
|
|
this.numbers = numbers;
|
|
}
|
|
}
|