001    /**
002     * Copyright (c) 2000-2012 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.service.ServiceContext serviceContext) {
204                    _portalPreferences.setExpandoBridgeAttributes(serviceContext);
205            }
206    
207            @Override
208            public java.lang.Object clone() {
209                    return new PortalPreferencesWrapper((PortalPreferences)_portalPreferences.clone());
210            }
211    
212            public int compareTo(
213                    com.liferay.portal.model.PortalPreferences portalPreferences) {
214                    return _portalPreferences.compareTo(portalPreferences);
215            }
216    
217            @Override
218            public int hashCode() {
219                    return _portalPreferences.hashCode();
220            }
221    
222            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.PortalPreferences> toCacheModel() {
223                    return _portalPreferences.toCacheModel();
224            }
225    
226            public com.liferay.portal.model.PortalPreferences toEscapedModel() {
227                    return new PortalPreferencesWrapper(_portalPreferences.toEscapedModel());
228            }
229    
230            public com.liferay.portal.model.PortalPreferences toUnescapedModel() {
231                    return new PortalPreferencesWrapper(_portalPreferences.toUnescapedModel());
232            }
233    
234            @Override
235            public java.lang.String toString() {
236                    return _portalPreferences.toString();
237            }
238    
239            public java.lang.String toXmlString() {
240                    return _portalPreferences.toXmlString();
241            }
242    
243            public void persist()
244                    throws com.liferay.portal.kernel.exception.SystemException {
245                    _portalPreferences.persist();
246            }
247    
248            /**
249             * @deprecated Renamed to {@link #getWrappedModel}
250             */
251            public PortalPreferences getWrappedPortalPreferences() {
252                    return _portalPreferences;
253            }
254    
255            public PortalPreferences getWrappedModel() {
256                    return _portalPreferences;
257            }
258    
259            public void resetOriginalValues() {
260                    _portalPreferences.resetOriginalValues();
261            }
262    
263            private PortalPreferences _portalPreferences;
264    }