107 lines
2.4 KiB
Java
107 lines
2.4 KiB
Java
package eu.dnetlib.uoamonitorservice.entities;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
import org.springframework.data.annotation.Id;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
public class Topic<StringOrCategory> {
|
|
@Id
|
|
@JsonProperty("_id")
|
|
private String id;
|
|
|
|
private String name;
|
|
private String alias;
|
|
private String description;
|
|
private boolean isActive;
|
|
private boolean isPublic;
|
|
private String defaultId;
|
|
private List<StringOrCategory> categories;
|
|
|
|
public Topic() {}
|
|
public Topic(Topic topic) {
|
|
id = topic.getId();
|
|
name = topic.getName();
|
|
alias = topic.getAlias();
|
|
description = topic.getDescription();
|
|
isActive = topic.getIsActive();
|
|
isPublic = topic.getIsPublic();
|
|
defaultId = topic.getDefaultId();
|
|
}
|
|
|
|
public void copyFromDefault(Topic defaultTopic) {
|
|
setName(defaultTopic.getName());
|
|
setAlias(defaultTopic.getAlias());
|
|
setDescription(defaultTopic.getDescription());
|
|
setIsActive(false);
|
|
setIsPublic(false);
|
|
setDefaultId(defaultTopic.getId());
|
|
setCategories(new ArrayList());
|
|
}
|
|
|
|
public String getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(String id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public void setName(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
public String getAlias() {
|
|
return alias;
|
|
}
|
|
|
|
public void setAlias(String alias) {
|
|
this.alias = alias;
|
|
}
|
|
|
|
public String getDescription() {
|
|
return description;
|
|
}
|
|
|
|
public void setDescription(String description) {
|
|
this.description = description;
|
|
}
|
|
|
|
public boolean getIsActive() {
|
|
return isActive;
|
|
}
|
|
|
|
public void setIsActive(boolean isActive) {
|
|
this.isActive = isActive;
|
|
}
|
|
|
|
public boolean getIsPublic() {
|
|
return isPublic;
|
|
}
|
|
|
|
public void setIsPublic(boolean isPublic) {
|
|
this.isPublic = isPublic;
|
|
}
|
|
|
|
public String getDefaultId() {
|
|
return defaultId;
|
|
}
|
|
|
|
public void setDefaultId(String defaultId) {
|
|
this.defaultId = defaultId;
|
|
}
|
|
|
|
public List<StringOrCategory> getCategories() {
|
|
return categories;
|
|
}
|
|
|
|
public void setCategories(List<StringOrCategory> categories) {
|
|
this.categories = categories;
|
|
}
|
|
}
|