001
014
015 package com.liferay.portal.model;
016
017 import java.util.HashMap;
018 import java.util.Map;
019
020
029 public class PortletPreferencesWrapper implements PortletPreferences,
030 ModelWrapper<PortletPreferences> {
031 public PortletPreferencesWrapper(PortletPreferences portletPreferences) {
032 _portletPreferences = portletPreferences;
033 }
034
035 public Class<?> getModelClass() {
036 return PortletPreferences.class;
037 }
038
039 public String getModelClassName() {
040 return PortletPreferences.class.getName();
041 }
042
043 public Map<String, Object> getModelAttributes() {
044 Map<String, Object> attributes = new HashMap<String, Object>();
045
046 attributes.put("portletPreferencesId", getPortletPreferencesId());
047 attributes.put("ownerId", getOwnerId());
048 attributes.put("ownerType", getOwnerType());
049 attributes.put("plid", getPlid());
050 attributes.put("portletId", getPortletId());
051 attributes.put("preferences", getPreferences());
052
053 return attributes;
054 }
055
056 public void setModelAttributes(Map<String, Object> attributes) {
057 Long portletPreferencesId = (Long)attributes.get("portletPreferencesId");
058
059 if (portletPreferencesId != null) {
060 setPortletPreferencesId(portletPreferencesId);
061 }
062
063 Long ownerId = (Long)attributes.get("ownerId");
064
065 if (ownerId != null) {
066 setOwnerId(ownerId);
067 }
068
069 Integer ownerType = (Integer)attributes.get("ownerType");
070
071 if (ownerType != null) {
072 setOwnerType(ownerType);
073 }
074
075 Long plid = (Long)attributes.get("plid");
076
077 if (plid != null) {
078 setPlid(plid);
079 }
080
081 String portletId = (String)attributes.get("portletId");
082
083 if (portletId != null) {
084 setPortletId(portletId);
085 }
086
087 String preferences = (String)attributes.get("preferences");
088
089 if (preferences != null) {
090 setPreferences(preferences);
091 }
092 }
093
094
099 public long getPrimaryKey() {
100 return _portletPreferences.getPrimaryKey();
101 }
102
103
108 public void setPrimaryKey(long primaryKey) {
109 _portletPreferences.setPrimaryKey(primaryKey);
110 }
111
112
117 public long getPortletPreferencesId() {
118 return _portletPreferences.getPortletPreferencesId();
119 }
120
121
126 public void setPortletPreferencesId(long portletPreferencesId) {
127 _portletPreferences.setPortletPreferencesId(portletPreferencesId);
128 }
129
130
135 public long getOwnerId() {
136 return _portletPreferences.getOwnerId();
137 }
138
139
144 public void setOwnerId(long ownerId) {
145 _portletPreferences.setOwnerId(ownerId);
146 }
147
148
153 public int getOwnerType() {
154 return _portletPreferences.getOwnerType();
155 }
156
157
162 public void setOwnerType(int ownerType) {
163 _portletPreferences.setOwnerType(ownerType);
164 }
165
166
171 public long getPlid() {
172 return _portletPreferences.getPlid();
173 }
174
175
180 public void setPlid(long plid) {
181 _portletPreferences.setPlid(plid);
182 }
183
184
189 public java.lang.String getPortletId() {
190 return _portletPreferences.getPortletId();
191 }
192
193
198 public void setPortletId(java.lang.String portletId) {
199 _portletPreferences.setPortletId(portletId);
200 }
201
202
207 public java.lang.String getPreferences() {
208 return _portletPreferences.getPreferences();
209 }
210
211
216 public void setPreferences(java.lang.String preferences) {
217 _portletPreferences.setPreferences(preferences);
218 }
219
220 public boolean isNew() {
221 return _portletPreferences.isNew();
222 }
223
224 public void setNew(boolean n) {
225 _portletPreferences.setNew(n);
226 }
227
228 public boolean isCachedModel() {
229 return _portletPreferences.isCachedModel();
230 }
231
232 public void setCachedModel(boolean cachedModel) {
233 _portletPreferences.setCachedModel(cachedModel);
234 }
235
236 public boolean isEscapedModel() {
237 return _portletPreferences.isEscapedModel();
238 }
239
240 public java.io.Serializable getPrimaryKeyObj() {
241 return _portletPreferences.getPrimaryKeyObj();
242 }
243
244 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
245 _portletPreferences.setPrimaryKeyObj(primaryKeyObj);
246 }
247
248 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
249 return _portletPreferences.getExpandoBridge();
250 }
251
252 public void setExpandoBridgeAttributes(
253 com.liferay.portal.model.BaseModel<?> baseModel) {
254 _portletPreferences.setExpandoBridgeAttributes(baseModel);
255 }
256
257 public void setExpandoBridgeAttributes(
258 com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
259 _portletPreferences.setExpandoBridgeAttributes(expandoBridge);
260 }
261
262 public void setExpandoBridgeAttributes(
263 com.liferay.portal.service.ServiceContext serviceContext) {
264 _portletPreferences.setExpandoBridgeAttributes(serviceContext);
265 }
266
267 @Override
268 public java.lang.Object clone() {
269 return new PortletPreferencesWrapper((PortletPreferences)_portletPreferences.clone());
270 }
271
272 public int compareTo(
273 com.liferay.portal.model.PortletPreferences portletPreferences) {
274 return _portletPreferences.compareTo(portletPreferences);
275 }
276
277 @Override
278 public int hashCode() {
279 return _portletPreferences.hashCode();
280 }
281
282 public com.liferay.portal.model.CacheModel<com.liferay.portal.model.PortletPreferences> toCacheModel() {
283 return _portletPreferences.toCacheModel();
284 }
285
286 public com.liferay.portal.model.PortletPreferences toEscapedModel() {
287 return new PortletPreferencesWrapper(_portletPreferences.toEscapedModel());
288 }
289
290 public com.liferay.portal.model.PortletPreferences toUnescapedModel() {
291 return new PortletPreferencesWrapper(_portletPreferences.toUnescapedModel());
292 }
293
294 @Override
295 public java.lang.String toString() {
296 return _portletPreferences.toString();
297 }
298
299 public java.lang.String toXmlString() {
300 return _portletPreferences.toXmlString();
301 }
302
303 public void persist()
304 throws com.liferay.portal.kernel.exception.SystemException {
305 _portletPreferences.persist();
306 }
307
308
311 public PortletPreferences getWrappedPortletPreferences() {
312 return _portletPreferences;
313 }
314
315 public PortletPreferences getWrappedModel() {
316 return _portletPreferences;
317 }
318
319 public void resetOriginalValues() {
320 _portletPreferences.resetOriginalValues();
321 }
322
323 private PortletPreferences _portletPreferences;
324 }