001    /**
002     * Copyright (c) 2000-present 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("mvccVersion", getMvccVersion());
055                    attributes.put("portalPreferencesId", getPortalPreferencesId());
056                    attributes.put("ownerId", getOwnerId());
057                    attributes.put("ownerType", getOwnerType());
058                    attributes.put("preferences", getPreferences());
059    
060                    return attributes;
061            }
062    
063            @Override
064            public void setModelAttributes(Map<String, Object> attributes) {
065                    Long mvccVersion = (Long)attributes.get("mvccVersion");
066    
067                    if (mvccVersion != null) {
068                            setMvccVersion(mvccVersion);
069                    }
070    
071                    Long portalPreferencesId = (Long)attributes.get("portalPreferencesId");
072    
073                    if (portalPreferencesId != null) {
074                            setPortalPreferencesId(portalPreferencesId);
075                    }
076    
077                    Long ownerId = (Long)attributes.get("ownerId");
078    
079                    if (ownerId != null) {
080                            setOwnerId(ownerId);
081                    }
082    
083                    Integer ownerType = (Integer)attributes.get("ownerType");
084    
085                    if (ownerType != null) {
086                            setOwnerType(ownerType);
087                    }
088    
089                    String preferences = (String)attributes.get("preferences");
090    
091                    if (preferences != null) {
092                            setPreferences(preferences);
093                    }
094            }
095    
096            @Override
097            public java.lang.Object clone() {
098                    return new PortalPreferencesWrapper((PortalPreferences)_portalPreferences.clone());
099            }
100    
101            @Override
102            public int compareTo(
103                    com.liferay.portal.model.PortalPreferences portalPreferences) {
104                    return _portalPreferences.compareTo(portalPreferences);
105            }
106    
107            @Override
108            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
109                    return _portalPreferences.getExpandoBridge();
110            }
111    
112            /**
113            * Returns the mvcc version of this portal preferences.
114            *
115            * @return the mvcc version of this portal preferences
116            */
117            @Override
118            public long getMvccVersion() {
119                    return _portalPreferences.getMvccVersion();
120            }
121    
122            /**
123            * Returns the owner ID of this portal preferences.
124            *
125            * @return the owner ID of this portal preferences
126            */
127            @Override
128            public long getOwnerId() {
129                    return _portalPreferences.getOwnerId();
130            }
131    
132            /**
133            * Returns the owner type of this portal preferences.
134            *
135            * @return the owner type of this portal preferences
136            */
137            @Override
138            public int getOwnerType() {
139                    return _portalPreferences.getOwnerType();
140            }
141    
142            /**
143            * Returns the portal preferences ID of this portal preferences.
144            *
145            * @return the portal preferences ID of this portal preferences
146            */
147            @Override
148            public long getPortalPreferencesId() {
149                    return _portalPreferences.getPortalPreferencesId();
150            }
151    
152            /**
153            * Returns the preferences of this portal preferences.
154            *
155            * @return the preferences of this portal preferences
156            */
157            @Override
158            public java.lang.String getPreferences() {
159                    return _portalPreferences.getPreferences();
160            }
161    
162            /**
163            * Returns the primary key of this portal preferences.
164            *
165            * @return the primary key of this portal preferences
166            */
167            @Override
168            public long getPrimaryKey() {
169                    return _portalPreferences.getPrimaryKey();
170            }
171    
172            @Override
173            public java.io.Serializable getPrimaryKeyObj() {
174                    return _portalPreferences.getPrimaryKeyObj();
175            }
176    
177            @Override
178            public int hashCode() {
179                    return _portalPreferences.hashCode();
180            }
181    
182            @Override
183            public boolean isCachedModel() {
184                    return _portalPreferences.isCachedModel();
185            }
186    
187            @Override
188            public boolean isEscapedModel() {
189                    return _portalPreferences.isEscapedModel();
190            }
191    
192            @Override
193            public boolean isNew() {
194                    return _portalPreferences.isNew();
195            }
196    
197            @Override
198            public void persist() {
199                    _portalPreferences.persist();
200            }
201    
202            @Override
203            public void setCachedModel(boolean cachedModel) {
204                    _portalPreferences.setCachedModel(cachedModel);
205            }
206    
207            @Override
208            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
209                    _portalPreferences.setExpandoBridgeAttributes(baseModel);
210            }
211    
212            @Override
213            public void setExpandoBridgeAttributes(
214                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
215                    _portalPreferences.setExpandoBridgeAttributes(expandoBridge);
216            }
217    
218            @Override
219            public void setExpandoBridgeAttributes(
220                    com.liferay.portal.service.ServiceContext serviceContext) {
221                    _portalPreferences.setExpandoBridgeAttributes(serviceContext);
222            }
223    
224            /**
225            * Sets the mvcc version of this portal preferences.
226            *
227            * @param mvccVersion the mvcc version of this portal preferences
228            */
229            @Override
230            public void setMvccVersion(long mvccVersion) {
231                    _portalPreferences.setMvccVersion(mvccVersion);
232            }
233    
234            @Override
235            public void setNew(boolean n) {
236                    _portalPreferences.setNew(n);
237            }
238    
239            /**
240            * Sets the owner ID of this portal preferences.
241            *
242            * @param ownerId the owner ID of this portal preferences
243            */
244            @Override
245            public void setOwnerId(long ownerId) {
246                    _portalPreferences.setOwnerId(ownerId);
247            }
248    
249            /**
250            * Sets the owner type of this portal preferences.
251            *
252            * @param ownerType the owner type of this portal preferences
253            */
254            @Override
255            public void setOwnerType(int ownerType) {
256                    _portalPreferences.setOwnerType(ownerType);
257            }
258    
259            /**
260            * Sets the portal preferences ID of this portal preferences.
261            *
262            * @param portalPreferencesId the portal preferences ID of this portal preferences
263            */
264            @Override
265            public void setPortalPreferencesId(long portalPreferencesId) {
266                    _portalPreferences.setPortalPreferencesId(portalPreferencesId);
267            }
268    
269            /**
270            * Sets the preferences of this portal preferences.
271            *
272            * @param preferences the preferences of this portal preferences
273            */
274            @Override
275            public void setPreferences(java.lang.String preferences) {
276                    _portalPreferences.setPreferences(preferences);
277            }
278    
279            /**
280            * Sets the primary key of this portal preferences.
281            *
282            * @param primaryKey the primary key of this portal preferences
283            */
284            @Override
285            public void setPrimaryKey(long primaryKey) {
286                    _portalPreferences.setPrimaryKey(primaryKey);
287            }
288    
289            @Override
290            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
291                    _portalPreferences.setPrimaryKeyObj(primaryKeyObj);
292            }
293    
294            @Override
295            public CacheModel<com.liferay.portal.model.PortalPreferences> toCacheModel() {
296                    return _portalPreferences.toCacheModel();
297            }
298    
299            @Override
300            public com.liferay.portal.model.PortalPreferences toEscapedModel() {
301                    return new PortalPreferencesWrapper(_portalPreferences.toEscapedModel());
302            }
303    
304            @Override
305            public java.lang.String toString() {
306                    return _portalPreferences.toString();
307            }
308    
309            @Override
310            public com.liferay.portal.model.PortalPreferences toUnescapedModel() {
311                    return new PortalPreferencesWrapper(_portalPreferences.toUnescapedModel());
312            }
313    
314            @Override
315            public java.lang.String toXmlString() {
316                    return _portalPreferences.toXmlString();
317            }
318    
319            @Override
320            public boolean equals(Object obj) {
321                    if (this == obj) {
322                            return true;
323                    }
324    
325                    if (!(obj instanceof PortalPreferencesWrapper)) {
326                            return false;
327                    }
328    
329                    PortalPreferencesWrapper portalPreferencesWrapper = (PortalPreferencesWrapper)obj;
330    
331                    if (Validator.equals(_portalPreferences,
332                                            portalPreferencesWrapper._portalPreferences)) {
333                            return true;
334                    }
335    
336                    return false;
337            }
338    
339            @Override
340            public PortalPreferences getWrappedModel() {
341                    return _portalPreferences;
342            }
343    
344            @Override
345            public boolean isEntityCacheEnabled() {
346                    return _portalPreferences.isEntityCacheEnabled();
347            }
348    
349            @Override
350            public boolean isFinderCacheEnabled() {
351                    return _portalPreferences.isFinderCacheEnabled();
352            }
353    
354            @Override
355            public void resetOriginalValues() {
356                    _portalPreferences.resetOriginalValues();
357            }
358    
359            private final PortalPreferences _portalPreferences;
360    }