Project

General

Profile

1 58023 konstantin
package eu.dnetlib.uoaadmintoolslibrary.entities.fullEntities;
2
3
import com.fasterxml.jackson.annotation.JsonProperty;
4 59376 konstantin
import eu.dnetlib.uoaadmintoolslibrary.entities.PortalType;
5 58023 konstantin
import org.springframework.data.annotation.Id;
6
7
import java.util.List;
8
9
import eu.dnetlib.uoaadmintoolslibrary.entities.Portal;
10
11
public class PortalResponse {
12
    @Id
13
    @JsonProperty("_id")
14
    private String id;
15
16
    private String pid;
17
    private String name;
18 59376 konstantin
    private PortalType type; // explore, connect, community, monitor
19 59930 konstantin
    private String piwik;
20 58023 konstantin
    private List<PortalPage> pages;
21
    private List<PortalEntity> entities;
22
23
    public PortalResponse() {}
24
25
    public PortalResponse(Portal portal) {
26
        this.setId(portal.getId());
27
        this.setPid(portal.getPid());
28
        this.setName(portal.getName());
29 58038 konstantin
        this.setType(portal.getType());
30 59930 konstantin
        this.setPiwik(portal.getPiwik());
31 58023 konstantin
    }
32
33
    public String getId() {
34
        return id;
35
    }
36
37
    public void setId(String id) {
38
        this.id = id;
39
    }
40
41
    public String getPid() {
42
        return pid;
43
    }
44
45
    public void setPid(String pid) {
46
        this.pid = pid;
47
    }
48
49
    public String getName() {
50
        return name;
51
    }
52
53
    public void setName(String name) {
54
        this.name = name;
55
    }
56
57 58038 konstantin
    public String getType() {
58 59376 konstantin
        if(type == null) {
59
            return null;
60
        }
61
        return type.name();
62 58038 konstantin
    }
63
64
    public void setType(String type) {
65 59376 konstantin
        if(type == null) {
66
            this.type = null;
67
        } else {
68
            PortalType pType = PortalType.valueOf(type);
69
            this.type = pType;
70
        }
71 58038 konstantin
    }
72
73 59930 konstantin
    public String getPiwik() {
74
        return piwik;
75
    }
76
77
    public void setPiwik(String piwik) {
78
        this.piwik = piwik;
79
    }
80
81 58023 konstantin
    public List<PortalPage> getPages() { return pages; }
82
83
    public void setPages(List<PortalPage> pages) { this.pages = pages; }
84
85
    public List<PortalEntity> getEntities() { return entities; }
86
87
    public void setEntities(List<PortalEntity> entities) {
88
        this.entities = entities;
89
    }
90
}