68 lines
2.3 KiB
Java
68 lines
2.3 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 {
|
|
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 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;
|
|
}
|
|
}
|