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