001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.model;
016    
017    import java.util.HashMap;
018    import java.util.Map;
019    
020    /**
021     * <p>
022     * This class is a wrapper for {@link PortletPreferences}.
023     * </p>
024     *
025     * @author    Brian Wing Shun Chan
026     * @see       PortletPreferences
027     * @generated
028     */
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            /**
095            * Returns the primary key of this portlet preferences.
096            *
097            * @return the primary key of this portlet preferences
098            */
099            public long getPrimaryKey() {
100                    return _portletPreferences.getPrimaryKey();
101            }
102    
103            /**
104            * Sets the primary key of this portlet preferences.
105            *
106            * @param primaryKey the primary key of this portlet preferences
107            */
108            public void setPrimaryKey(long primaryKey) {
109                    _portletPreferences.setPrimaryKey(primaryKey);
110            }
111    
112            /**
113            * Returns the portlet preferences ID of this portlet preferences.
114            *
115            * @return the portlet preferences ID of this portlet preferences
116            */
117            public long getPortletPreferencesId() {
118                    return _portletPreferences.getPortletPreferencesId();
119            }
120    
121            /**
122            * Sets the portlet preferences ID of this portlet preferences.
123            *
124            * @param portletPreferencesId the portlet preferences ID of this portlet preferences
125            */
126            public void setPortletPreferencesId(long portletPreferencesId) {
127                    _portletPreferences.setPortletPreferencesId(portletPreferencesId);
128            }
129    
130            /**
131            * Returns the owner ID of this portlet preferences.
132            *
133            * @return the owner ID of this portlet preferences
134            */
135            public long getOwnerId() {
136                    return _portletPreferences.getOwnerId();
137            }
138    
139            /**
140            * Sets the owner ID of this portlet preferences.
141            *
142            * @param ownerId the owner ID of this portlet preferences
143            */
144            public void setOwnerId(long ownerId) {
145                    _portletPreferences.setOwnerId(ownerId);
146            }
147    
148            /**
149            * Returns the owner type of this portlet preferences.
150            *
151            * @return the owner type of this portlet preferences
152            */
153            public int getOwnerType() {
154                    return _portletPreferences.getOwnerType();
155            }
156    
157            /**
158            * Sets the owner type of this portlet preferences.
159            *
160            * @param ownerType the owner type of this portlet preferences
161            */
162            public void setOwnerType(int ownerType) {
163                    _portletPreferences.setOwnerType(ownerType);
164            }
165    
166            /**
167            * Returns the plid of this portlet preferences.
168            *
169            * @return the plid of this portlet preferences
170            */
171            public long getPlid() {
172                    return _portletPreferences.getPlid();
173            }
174    
175            /**
176            * Sets the plid of this portlet preferences.
177            *
178            * @param plid the plid of this portlet preferences
179            */
180            public void setPlid(long plid) {
181                    _portletPreferences.setPlid(plid);
182            }
183    
184            /**
185            * Returns the portlet ID of this portlet preferences.
186            *
187            * @return the portlet ID of this portlet preferences
188            */
189            public java.lang.String getPortletId() {
190                    return _portletPreferences.getPortletId();
191            }
192    
193            /**
194            * Sets the portlet ID of this portlet preferences.
195            *
196            * @param portletId the portlet ID of this portlet preferences
197            */
198            public void setPortletId(java.lang.String portletId) {
199                    _portletPreferences.setPortletId(portletId);
200            }
201    
202            /**
203            * Returns the preferences of this portlet preferences.
204            *
205            * @return the preferences of this portlet preferences
206            */
207            public java.lang.String getPreferences() {
208                    return _portletPreferences.getPreferences();
209            }
210    
211            /**
212            * Sets the preferences of this portlet preferences.
213            *
214            * @param preferences the preferences of this portlet preferences
215            */
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            /**
309             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
310             */
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    }