89 lines
2.3 KiB
Java
89 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 org.springframework.data.mongodb.core.mapping.Document;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
|
|
@Document
|
|
public class CategoryGeneric<StringOrSubcategory> extends Common {
|
|
@Id
|
|
@JsonProperty("_id")
|
|
protected String id;
|
|
@CreatedDate
|
|
protected Date creationDate;
|
|
@LastModifiedDate
|
|
protected Date updateDate;
|
|
protected boolean isOverview;
|
|
protected String defaultId;
|
|
protected List<StringOrSubcategory> subCategories;
|
|
|
|
public CategoryGeneric() {}
|
|
|
|
public CategoryGeneric(CategoryGeneric category) {
|
|
id = category.getId();
|
|
name = category.getName();
|
|
alias = category.getAlias();
|
|
description = category.getDescription();
|
|
setVisibility(category.getVisibility());
|
|
creationDate = category.getCreationDate();
|
|
updateDate = category.getUpdateDate();
|
|
defaultId = category.getDefaultId();
|
|
}
|
|
|
|
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 boolean getIsOverview() {
|
|
return isOverview;
|
|
}
|
|
|
|
public void setIsOverview(boolean isOverview) {
|
|
this.isOverview = isOverview;
|
|
}
|
|
|
|
public String getDefaultId() {
|
|
return defaultId;
|
|
}
|
|
|
|
public void setDefaultId(String defaultId) {
|
|
this.defaultId = defaultId;
|
|
}
|
|
|
|
public List<StringOrSubcategory> getSubCategories() {
|
|
return subCategories;
|
|
}
|
|
|
|
public void setSubCategories(List<StringOrSubcategory> subCategories) {
|
|
this.subCategories = subCategories;
|
|
}
|
|
}
|