-
Notifications
You must be signed in to change notification settings - Fork 461
/
ContainerRaw.java
81 lines (70 loc) · 2.7 KB
/
ContainerRaw.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package com.dotmarketing.portlets.htmlpageasset.business.render;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import com.dotmarketing.beans.Host;
import com.dotmarketing.portlets.containers.model.ContainerView;
import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableList;
import com.dotmarketing.beans.ContainerStructure;
import com.dotmarketing.portlets.containers.model.Container;
/**
* Represents the information of the {@link Container} and its respective {@link ContainerStructure}
* relationships. These relationships define what Content Types can be added to the container.
*
* @author Will Ezell
* @author Jose Castro
* @version 4.2
* @since Oct 6, 2017
*/
public class ContainerRaw implements Serializable {
private static final long serialVersionUID = 1572918359580445566L;
private final Container container;
private final List<ContainerStructure> containerStructures;
private final Map<String, List<Map<String,Object>>> contentlets;
/**
* Creates a new instance of the ContainerRendered.
*
* @param container The {@link Container} in the HTML Page.
* @param containerStructures The list of {@link ContainerStructure} relationships. the browser.
*/
public ContainerRaw(
final Container container,
final List<ContainerStructure> containerStructures,
final Map<String, List<Map<String,Object>>> contentlets) {
this.container = container;
this.containerStructures = (containerStructures != null) ? ImmutableList.copyOf(containerStructures) : ImmutableList.of();
this.contentlets = contentlets;
}
public Map<String, List<Map<String,Object>>> getContentlets() {
return contentlets;
}
/**
* Returns the page container.
*
* @return The {@link Container} in the page.
*/
@JsonIgnore
public Container getContainer() {
return container;
}
@JsonProperty("container")
public ContainerView getContainerView() {
return new ContainerView(container);
}
/**
* Returns the relationships that determine what Content Types can be added to a specific Container.
*
* @return The list of {@link ContainerStructure} relationships.
*/
public List<ContainerStructure> getContainerStructures() {
return containerStructures;
}
@Override
public String toString() {
return "ContainerRendered{" + "container=" + container + ", containerStructures=" + containerStructures + ", contentlets='"
+ contentlets + '\'' + '}';
}
}