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