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