1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kim.bo.entity.dto; |
17 | |
|
18 | |
import java.util.ArrayList; |
19 | |
import java.util.List; |
20 | |
|
21 | |
import org.kuali.rice.kim.bo.entity.KimEntityAddress; |
22 | |
import org.kuali.rice.kim.bo.entity.KimEntityEmail; |
23 | |
import org.kuali.rice.kim.bo.entity.KimEntityEntityType; |
24 | |
import org.kuali.rice.kim.bo.entity.KimEntityPhone; |
25 | |
import org.kuali.rice.kim.bo.reference.dto.EntityTypeInfo; |
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | 0 | public class KimEntityEntityTypeInfo extends KimInactivatableInfo implements KimEntityEntityType { |
33 | |
|
34 | |
private static final long serialVersionUID = -6849727371078726861L; |
35 | |
|
36 | |
private List<KimEntityAddressInfo> addresses; |
37 | |
private KimEntityAddressInfo defaultAddress; |
38 | |
private List<KimEntityEmailInfo> emailAddresses; |
39 | |
private KimEntityEmailInfo defaultEmailAddress; |
40 | |
private EntityTypeInfo entityType; |
41 | 0 | private String entityTypeCode = ""; |
42 | |
private List<KimEntityPhoneInfo> phoneNumbers; |
43 | |
private KimEntityPhoneInfo defaultPhoneNumber; |
44 | |
|
45 | |
public KimEntityEntityTypeInfo() { |
46 | 0 | super(); |
47 | 0 | active = true; |
48 | 0 | } |
49 | |
|
50 | |
public KimEntityEntityTypeInfo(KimEntityEntityType kimEntityEntityType) { |
51 | 0 | this(); |
52 | 0 | if ( kimEntityEntityType != null ) { |
53 | 0 | active = kimEntityEntityType.isActive(); |
54 | 0 | entityTypeCode = kimEntityEntityType.getEntityTypeCode(); |
55 | 0 | if (kimEntityEntityType.getEntityType() != null) { |
56 | 0 | entityType = new EntityTypeInfo(kimEntityEntityType.getEntityType()); |
57 | |
} |
58 | 0 | if (kimEntityEntityType.getAddresses() != null) { |
59 | 0 | addresses = new ArrayList<KimEntityAddressInfo>( kimEntityEntityType.getAddresses().size() ); |
60 | 0 | for ( KimEntityAddress p : kimEntityEntityType.getAddresses() ) if (p != null) { |
61 | 0 | addresses.add( new KimEntityAddressInfo( p ) ); |
62 | |
} |
63 | |
} |
64 | 0 | if (kimEntityEntityType.getDefaultAddress() != null) { |
65 | 0 | defaultAddress = new KimEntityAddressInfo(kimEntityEntityType.getDefaultAddress()); |
66 | |
} |
67 | 0 | if (kimEntityEntityType.getEmailAddresses() != null) { |
68 | 0 | emailAddresses = new ArrayList<KimEntityEmailInfo>( kimEntityEntityType.getEmailAddresses().size() ); |
69 | 0 | for ( KimEntityEmail p : kimEntityEntityType.getEmailAddresses() ) if (p != null) { |
70 | 0 | emailAddresses.add( new KimEntityEmailInfo( p ) ); |
71 | |
} |
72 | |
} |
73 | 0 | if (kimEntityEntityType.getDefaultEmailAddress() != null) { |
74 | 0 | defaultEmailAddress = new KimEntityEmailInfo(kimEntityEntityType.getDefaultEmailAddress()); |
75 | |
} |
76 | 0 | if (kimEntityEntityType.getPhoneNumbers() != null) { |
77 | 0 | phoneNumbers = new ArrayList<KimEntityPhoneInfo>( kimEntityEntityType.getPhoneNumbers().size() ); |
78 | 0 | for ( KimEntityPhone p : kimEntityEntityType.getPhoneNumbers() ) if (p != null) { |
79 | 0 | phoneNumbers.add( new KimEntityPhoneInfo( p ) ); |
80 | |
} |
81 | |
} |
82 | 0 | if (kimEntityEntityType.getDefaultPhoneNumber() != null) { |
83 | 0 | defaultPhoneNumber = new KimEntityPhoneInfo(kimEntityEntityType.getDefaultPhoneNumber()); |
84 | |
} |
85 | |
} |
86 | 0 | } |
87 | |
|
88 | |
|
89 | |
|
90 | |
|
91 | |
|
92 | |
public List<KimEntityAddressInfo> getAddresses() { |
93 | |
|
94 | 0 | return (addresses != null) ? addresses : (addresses = new ArrayList<KimEntityAddressInfo>()); |
95 | |
} |
96 | |
|
97 | |
|
98 | |
|
99 | |
|
100 | |
public void setAddresses(List<KimEntityAddressInfo> addresses) { |
101 | 0 | this.addresses = addresses; |
102 | 0 | } |
103 | |
|
104 | |
|
105 | |
|
106 | |
|
107 | |
|
108 | |
public KimEntityAddressInfo getDefaultAddress() { |
109 | 0 | return defaultAddress; |
110 | |
} |
111 | |
|
112 | |
|
113 | |
|
114 | |
|
115 | |
public void setDefaultAddress(KimEntityAddressInfo defaultAddress) { |
116 | 0 | this.defaultAddress = defaultAddress; |
117 | 0 | } |
118 | |
|
119 | |
|
120 | |
|
121 | |
|
122 | |
|
123 | |
public List<KimEntityEmailInfo> getEmailAddresses() { |
124 | 0 | return emailAddresses; |
125 | |
} |
126 | |
|
127 | |
|
128 | |
|
129 | |
|
130 | |
public void setEmailAddresses(List<KimEntityEmailInfo> emailAddresses) { |
131 | 0 | this.emailAddresses = emailAddresses; |
132 | 0 | } |
133 | |
|
134 | |
|
135 | |
|
136 | |
|
137 | |
|
138 | |
public KimEntityEmailInfo getDefaultEmailAddress() { |
139 | 0 | return defaultEmailAddress; |
140 | |
} |
141 | |
|
142 | |
|
143 | |
|
144 | |
|
145 | |
public void setDefaultEmailAddress(KimEntityEmailInfo defaultEmailAddress) { |
146 | 0 | this.defaultEmailAddress = defaultEmailAddress; |
147 | 0 | } |
148 | |
|
149 | |
|
150 | |
|
151 | |
|
152 | |
|
153 | |
public EntityTypeInfo getEntityType() { |
154 | 0 | return entityType; |
155 | |
} |
156 | |
|
157 | |
|
158 | |
|
159 | |
|
160 | |
public void setEntityType(EntityTypeInfo entityType) { |
161 | 0 | this.entityType = entityType; |
162 | 0 | } |
163 | |
|
164 | |
|
165 | |
|
166 | |
|
167 | |
|
168 | |
public String getEntityTypeCode() { |
169 | 0 | return entityTypeCode; |
170 | |
} |
171 | |
|
172 | |
|
173 | |
|
174 | |
|
175 | |
public void setEntityTypeCode(String entityTypeCode) { |
176 | 0 | this.entityTypeCode = entityTypeCode; |
177 | 0 | } |
178 | |
|
179 | |
|
180 | |
|
181 | |
|
182 | |
|
183 | |
public List<KimEntityPhoneInfo> getPhoneNumbers() { |
184 | |
|
185 | 0 | return (phoneNumbers != null) ? phoneNumbers : (phoneNumbers = new ArrayList<KimEntityPhoneInfo>()); |
186 | |
} |
187 | |
|
188 | |
|
189 | |
|
190 | |
|
191 | |
public void setPhoneNumbers(List<KimEntityPhoneInfo> phoneNumbers) { |
192 | 0 | this.phoneNumbers = phoneNumbers; |
193 | 0 | } |
194 | |
|
195 | |
|
196 | |
|
197 | |
|
198 | |
|
199 | |
public KimEntityPhoneInfo getDefaultPhoneNumber() { |
200 | 0 | return defaultPhoneNumber; |
201 | |
} |
202 | |
|
203 | |
|
204 | |
|
205 | |
|
206 | |
public void setDefaultPhoneNumber(KimEntityPhoneInfo defaultPhoneNumber) { |
207 | 0 | this.defaultPhoneNumber = defaultPhoneNumber; |
208 | 0 | } |
209 | |
|
210 | |
} |