Project

General

Profile

1
package eu.dnetlib.uoaadmintoolslibrary.entities.fullEntities;
2

    
3
import com.fasterxml.jackson.annotation.JsonProperty;
4
import eu.dnetlib.uoaadmintoolslibrary.entities.PortalType;
5
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
    private PortalType type; // explore, connect, community, monitor
19
    private String piwik;
20
    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
        this.setType(portal.getType());
30
        this.setPiwik(portal.getPiwik());
31
    }
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
    public String getType() {
58
        if(type == null) {
59
            return null;
60
        }
61
        return type.name();
62
    }
63

    
64
    public void setType(String type) {
65
        if(type == null) {
66
            this.type = null;
67
        } else {
68
            PortalType pType = PortalType.valueOf(type);
69
            this.type = pType;
70
        }
71
    }
72

    
73
    public String getPiwik() {
74
        return piwik;
75
    }
76

    
77
    public void setPiwik(String piwik) {
78
        this.piwik = piwik;
79
    }
80

    
81
    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
}
(6-6/6)