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