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