1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.r2.core.room.dto; |
17 | |
|
18 | |
import org.kuali.student.r2.common.dto.IdEntityInfo; |
19 | |
import org.kuali.student.r2.core.room.infc.Room; |
20 | |
import org.kuali.student.r2.core.room.infc.RoomUsage; |
21 | |
import org.kuali.student.r2.core.room.infc.RoomFixedResource; |
22 | |
import org.w3c.dom.Element; |
23 | |
|
24 | |
import javax.xml.bind.annotation.XmlAccessType; |
25 | |
import javax.xml.bind.annotation.XmlAccessorType; |
26 | |
import javax.xml.bind.annotation.XmlAnyElement; |
27 | |
import javax.xml.bind.annotation.XmlElement; |
28 | |
import javax.xml.bind.annotation.XmlType; |
29 | |
import java.io.Serializable; |
30 | |
import java.util.ArrayList; |
31 | |
import java.util.List; |
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
@XmlAccessorType(XmlAccessType.FIELD) |
39 | |
@XmlType(name = "RoomInfo", propOrder = {"id", "typeKey", "stateKey", |
40 | |
"name", "descr", "roomCode", "buildingId", "floor", "roomFixedResources", "roomUsages", "accessibilityTypeKeys", |
41 | |
"meta", "attributes", "_futureElements"}) |
42 | |
|
43 | |
public class RoomInfo extends IdEntityInfo implements Room, Serializable { |
44 | |
|
45 | |
private static final long serialVersionUID = 1L; |
46 | |
|
47 | |
@XmlElement |
48 | |
private String roomCode; |
49 | |
|
50 | |
@XmlElement |
51 | |
private String buildingId; |
52 | |
|
53 | |
@XmlElement |
54 | |
private String floor; |
55 | |
|
56 | |
@XmlElement |
57 | |
List<RoomFixedResourceInfo> roomFixedResources; |
58 | |
|
59 | |
@XmlElement |
60 | |
List<RoomUsageInfo> roomUsages; |
61 | |
|
62 | |
@XmlElement |
63 | |
List<String> accessibilityTypeKeys; |
64 | |
|
65 | |
@XmlAnyElement |
66 | |
private List<Element> _futureElements; |
67 | |
|
68 | 0 | public RoomInfo() { |
69 | 0 | } |
70 | |
|
71 | |
public RoomInfo(Room room) { |
72 | 0 | super(room); |
73 | 0 | if (null != room) { |
74 | 0 | this.roomCode = room.getRoomCode(); |
75 | 0 | this.buildingId = room.getBuildingId(); |
76 | 0 | this.floor = room.getFloor(); |
77 | |
|
78 | 0 | this.roomFixedResources = new ArrayList<RoomFixedResourceInfo>(); |
79 | 0 | for (RoomFixedResource resource : room.getRoomFixedResources()) { |
80 | 0 | this.roomFixedResources.add(new RoomFixedResourceInfo(resource)); |
81 | |
} |
82 | |
|
83 | 0 | this.roomUsages = new ArrayList<RoomUsageInfo>(); |
84 | 0 | for (RoomUsage usage : room.getRoomUsages()) { |
85 | 0 | this.roomUsages.add(new RoomUsageInfo(usage)); |
86 | |
} |
87 | |
|
88 | 0 | if (null != room.getAccessibilityTypeKeys()) { |
89 | 0 | this.accessibilityTypeKeys = new ArrayList<String>(room.getAccessibilityTypeKeys()); |
90 | |
} |
91 | |
} |
92 | 0 | } |
93 | |
|
94 | |
@Override |
95 | |
public String getRoomCode() { |
96 | 0 | return this.roomCode; |
97 | |
} |
98 | |
|
99 | |
public void setRoomCode(String roomCode) { |
100 | 0 | this.roomCode = roomCode; |
101 | 0 | } |
102 | |
|
103 | |
@Override |
104 | |
public String getBuildingId() { |
105 | 0 | return this.buildingId; |
106 | |
} |
107 | |
|
108 | |
public void setBuildingId(String buildingId) { |
109 | 0 | this.buildingId = buildingId; |
110 | 0 | } |
111 | |
|
112 | |
@Override |
113 | |
public String getFloor() { |
114 | 0 | return this.floor; |
115 | |
} |
116 | |
|
117 | |
public void setFloor(String floor) { |
118 | 0 | this.floor = floor; |
119 | 0 | } |
120 | |
|
121 | |
@Override |
122 | |
public List<RoomFixedResourceInfo> getRoomFixedResources() { |
123 | 0 | return this.roomFixedResources; |
124 | |
} |
125 | |
|
126 | |
public void setRoomFixedResources(List<RoomFixedResourceInfo> roomFixedResources) { |
127 | 0 | this.roomFixedResources = roomFixedResources; |
128 | 0 | } |
129 | |
|
130 | |
@Override |
131 | |
public List<RoomUsageInfo> getRoomUsages() { |
132 | 0 | return this.roomUsages; |
133 | |
} |
134 | |
|
135 | |
public void setRoomUsages(List<RoomUsageInfo> roomUsages) { |
136 | 0 | this.roomUsages = roomUsages; |
137 | 0 | } |
138 | |
|
139 | |
@Override |
140 | |
public List<String> getAccessibilityTypeKeys() { |
141 | 0 | return this.accessibilityTypeKeys; |
142 | |
} |
143 | |
|
144 | |
public void setAccessibilityTypeKeys(List<String> accessibilityTypeKeys) { |
145 | 0 | this.accessibilityTypeKeys = accessibilityTypeKeys; |
146 | 0 | } |
147 | |
|
148 | |
} |