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(
209                    com.liferay.portal.model.BaseModel<?> baseModel) {
210                    _portalPreferences.setExpandoBridgeAttributes(baseModel);
211            }
212    
213            @Override
214            public void setExpandoBridgeAttributes(
215                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
216                    _portalPreferences.setExpandoBridgeAttributes(expandoBridge);
217            }
218    
219            @Override
220            public void setExpandoBridgeAttributes(
221                    com.liferay.portal.service.ServiceContext serviceContext) {
222                    _portalPreferences.setExpandoBridgeAttributes(serviceContext);
223            }
224    
225            /**
226            * Sets the mvcc version of this portal preferences.
227            *
228            * @param mvccVersion the mvcc version of this portal preferences
229            */
230            @Override
231            public void setMvccVersion(long mvccVersion) {
232                    _portalPreferences.setMvccVersion(mvccVersion);
233            }
234    
235            @Override
236            public void setNew(boolean n) {
237                    _portalPreferences.setNew(n);
238            }
239    
240            /**
241            * Sets the owner ID of this portal preferences.
242            *
243            * @param ownerId the owner ID of this portal preferences
244            */
245            @Override
246            public void setOwnerId(long ownerId) {
247                    _portalPreferences.setOwnerId(ownerId);
248            }
249    
250            /**
251            * Sets the owner type of this portal preferences.
252            *
253            * @param ownerType the owner type of this portal preferences
254            */
255            @Override
256            public void setOwnerType(int ownerType) {
257                    _portalPreferences.setOwnerType(ownerType);
258            }
259    
260            /**
261            * Sets the portal preferences ID of this portal preferences.
262            *
263            * @param portalPreferencesId the portal preferences ID of this portal preferences
264            */
265            @Override
266            public void setPortalPreferencesId(long portalPreferencesId) {
267                    _portalPreferences.setPortalPreferencesId(portalPreferencesId);
268            }
269    
270            /**
271            * Sets the preferences of this portal preferences.
272            *
273            * @param preferences the preferences of this portal preferences
274            */
275            @Override
276            public void setPreferences(java.lang.String preferences) {
277                    _portalPreferences.setPreferences(preferences);
278            }
279    
280            /**
281            * Sets the primary key of this portal preferences.
282            *
283            * @param primaryKey the primary key of this portal preferences
284            */
285            @Override
286            public void setPrimaryKey(long primaryKey) {
287                    _portalPreferences.setPrimaryKey(primaryKey);
288            }
289    
290            @Override
291            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
292                    _portalPreferences.setPrimaryKeyObj(primaryKeyObj);
293            }
294    
295            @Override
296            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.PortalPreferences> toCacheModel() {
297                    return _portalPreferences.toCacheModel();
298            }
299    
300            @Override
301            public com.liferay.portal.model.PortalPreferences toEscapedModel() {
302                    return new PortalPreferencesWrapper(_portalPreferences.toEscapedModel());
303            }
304    
305            @Override
306            public java.lang.String toString() {
307                    return _portalPreferences.toString();
308            }
309    
310            @Override
311            public com.liferay.portal.model.PortalPreferences toUnescapedModel() {
312                    return new PortalPreferencesWrapper(_portalPreferences.toUnescapedModel());
313            }
314    
315            @Override
316            public java.lang.String toXmlString() {
317                    return _portalPreferences.toXmlString();
318            }
319    
320            @Override
321            public boolean equals(Object obj) {
322                    if (this == obj) {
323                            return true;
324                    }
325    
326                    if (!(obj instanceof PortalPreferencesWrapper)) {
327                            return false;
328                    }
329    
330                    PortalPreferencesWrapper portalPreferencesWrapper = (PortalPreferencesWrapper)obj;
331    
332                    if (Validator.equals(_portalPreferences,
333                                            portalPreferencesWrapper._portalPreferences)) {
334                            return true;
335                    }
336    
337                    return false;
338            }
339    
340            /**
341             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
342             */
343            @Deprecated
344            public PortalPreferences getWrappedPortalPreferences() {
345                    return _portalPreferences;
346            }
347    
348            @Override
349            public PortalPreferences getWrappedModel() {
350                    return _portalPreferences;
351            }
352    
353            @Override
354            public boolean isEntityCacheEnabled() {
355                    return _portalPreferences.isEntityCacheEnabled();
356            }
357    
358            @Override
359            public boolean isFinderCacheEnabled() {
360                    return _portalPreferences.isFinderCacheEnabled();
361            }
362    
363            @Override
364            public void resetOriginalValues() {
365                    _portalPreferences.resetOriginalValues();
366            }
367    
368            private final PortalPreferences _portalPreferences;
369    }