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 PortalPreferences}.
023     * </p>
024     *
025     * @author    Brian Wing Shun Chan
026     * @see       PortalPreferences
027     * @generated
028     */
029    public class PortalPreferencesWrapper implements PortalPreferences,
030            ModelWrapper<PortalPreferences> {
031            public PortalPreferencesWrapper(PortalPreferences portalPreferences) {
032                    _portalPreferences = portalPreferences;
033            }
034    
035            public Class<?> getModelClass() {
036                    return PortalPreferences.class;
037            }
038    
039            public String getModelClassName() {
040                    return PortalPreferences.class.getName();
041            }
042    
043            public Map<String, Object> getModelAttributes() {
044                    Map<String, Object> attributes = new HashMap<String, Object>();
045    
046                    attributes.put("portalPreferencesId", getPortalPreferencesId());
047                    attributes.put("ownerId", getOwnerId());
048                    attributes.put("ownerType", getOwnerType());
049                    attributes.put("preferences", getPreferences());
050    
051                    return attributes;
052            }
053    
054            public void setModelAttributes(Map<String, Object> attributes) {
055                    Long portalPreferencesId = (Long)attributes.get("portalPreferencesId");
056    
057                    if (portalPreferencesId != null) {
058                            setPortalPreferencesId(portalPreferencesId);
059                    }
060    
061                    Long ownerId = (Long)attributes.get("ownerId");
062    
063                    if (ownerId != null) {
064                            setOwnerId(ownerId);
065                    }
066    
067                    Integer ownerType = (Integer)attributes.get("ownerType");
068    
069                    if (ownerType != null) {
070                            setOwnerType(ownerType);
071                    }
072    
073                    String preferences = (String)attributes.get("preferences");
074    
075                    if (preferences != null) {
076                            setPreferences(preferences);
077                    }
078            }
079    
080            /**
081            * Returns the primary key of this portal preferences.
082            *
083            * @return the primary key of this portal preferences
084            */
085            public long getPrimaryKey() {
086                    return _portalPreferences.getPrimaryKey();
087            }
088    
089            /**
090            * Sets the primary key of this portal preferences.
091            *
092            * @param primaryKey the primary key of this portal preferences
093            */
094            public void setPrimaryKey(long primaryKey) {
095                    _portalPreferences.setPrimaryKey(primaryKey);
096            }
097    
098            /**
099            * Returns the portal preferences ID of this portal preferences.
100            *
101            * @return the portal preferences ID of this portal preferences
102            */
103            public long getPortalPreferencesId() {
104                    return _portalPreferences.getPortalPreferencesId();
105            }
106    
107            /**
108            * Sets the portal preferences ID of this portal preferences.
109            *
110            * @param portalPreferencesId the portal preferences ID of this portal preferences
111            */
112            public void setPortalPreferencesId(long portalPreferencesId) {
113                    _portalPreferences.setPortalPreferencesId(portalPreferencesId);
114            }
115    
116            /**
117            * Returns the owner ID of this portal preferences.
118            *
119            * @return the owner ID of this portal preferences
120            */
121            public long getOwnerId() {
122                    return _portalPreferences.getOwnerId();
123            }
124    
125            /**
126            * Sets the owner ID of this portal preferences.
127            *
128            * @param ownerId the owner ID of this portal preferences
129            */
130            public void setOwnerId(long ownerId) {
131                    _portalPreferences.setOwnerId(ownerId);
132            }
133    
134            /**
135            * Returns the owner type of this portal preferences.
136            *
137            * @return the owner type of this portal preferences
138            */
139            public int getOwnerType() {
140                    return _portalPreferences.getOwnerType();
141            }
142    
143            /**
144            * Sets the owner type of this portal preferences.
145            *
146            * @param ownerType the owner type of this portal preferences
147            */
148            public void setOwnerType(int ownerType) {
149                    _portalPreferences.setOwnerType(ownerType);
150            }
151    
152            /**
153            * Returns the preferences of this portal preferences.
154            *
155            * @return the preferences of this portal preferences
156            */
157            public java.lang.String getPreferences() {
158                    return _portalPreferences.getPreferences();
159            }
160    
161            /**
162            * Sets the preferences of this portal preferences.
163            *
164            * @param preferences the preferences of this portal preferences
165            */
166            public void setPreferences(java.lang.String preferences) {
167                    _portalPreferences.setPreferences(preferences);
168            }
169    
170            public boolean isNew() {
171                    return _portalPreferences.isNew();
172            }
173    
174            public void setNew(boolean n) {
175                    _portalPreferences.setNew(n);
176            }
177    
178            public boolean isCachedModel() {
179                    return _portalPreferences.isCachedModel();
180            }
181    
182            public void setCachedModel(boolean cachedModel) {
183                    _portalPreferences.setCachedModel(cachedModel);
184            }
185    
186            public boolean isEscapedModel() {
187                    return _portalPreferences.isEscapedModel();
188            }
189    
190            public java.io.Serializable getPrimaryKeyObj() {
191                    return _portalPreferences.getPrimaryKeyObj();
192            }
193    
194            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
195                    _portalPreferences.setPrimaryKeyObj(primaryKeyObj);
196            }
197    
198            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
199                    return _portalPreferences.getExpandoBridge();
200            }
201    
202            public void setExpandoBridgeAttributes(
203                    com.liferay.portal.model.BaseModel<?> baseModel) {
204                    _portalPreferences.setExpandoBridgeAttributes(baseModel);
205            }
206    
207            public void setExpandoBridgeAttributes(
208                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
209                    _portalPreferences.setExpandoBridgeAttributes(expandoBridge);
210            }
211    
212            public void setExpandoBridgeAttributes(
213                    com.liferay.portal.service.ServiceContext serviceContext) {
214                    _portalPreferences.setExpandoBridgeAttributes(serviceContext);
215            }
216    
217            @Override
218            public java.lang.Object clone() {
219                    return new PortalPreferencesWrapper((PortalPreferences)_portalPreferences.clone());
220            }
221    
222            public int compareTo(
223                    com.liferay.portal.model.PortalPreferences portalPreferences) {
224                    return _portalPreferences.compareTo(portalPreferences);
225            }
226    
227            @Override
228            public int hashCode() {
229                    return _portalPreferences.hashCode();
230            }
231    
232            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.PortalPreferences> toCacheModel() {
233                    return _portalPreferences.toCacheModel();
234            }
235    
236            public com.liferay.portal.model.PortalPreferences toEscapedModel() {
237                    return new PortalPreferencesWrapper(_portalPreferences.toEscapedModel());
238            }
239    
240            public com.liferay.portal.model.PortalPreferences toUnescapedModel() {
241                    return new PortalPreferencesWrapper(_portalPreferences.toUnescapedModel());
242            }
243    
244            @Override
245            public java.lang.String toString() {
246                    return _portalPreferences.toString();
247            }
248    
249            public java.lang.String toXmlString() {
250                    return _portalPreferences.toXmlString();
251            }
252    
253            public void persist()
254                    throws com.liferay.portal.kernel.exception.SystemException {
255                    _portalPreferences.persist();
256            }
257    
258            /**
259             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
260             */
261            public PortalPreferences getWrappedPortalPreferences() {
262                    return _portalPreferences;
263            }
264    
265            public PortalPreferences getWrappedModel() {
266                    return _portalPreferences;
267            }
268    
269            public void resetOriginalValues() {
270                    _portalPreferences.resetOriginalValues();
271            }
272    
273            private PortalPreferences _portalPreferences;
274    }