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 PluginSetting}.
025     * </p>
026     *
027     * @author Brian Wing Shun Chan
028     * @see PluginSetting
029     * @generated
030     */
031    public class PluginSettingWrapper implements PluginSetting,
032            ModelWrapper<PluginSetting> {
033            public PluginSettingWrapper(PluginSetting pluginSetting) {
034                    _pluginSetting = pluginSetting;
035            }
036    
037            @Override
038            public Class<?> getModelClass() {
039                    return PluginSetting.class;
040            }
041    
042            @Override
043            public String getModelClassName() {
044                    return PluginSetting.class.getName();
045            }
046    
047            @Override
048            public Map<String, Object> getModelAttributes() {
049                    Map<String, Object> attributes = new HashMap<String, Object>();
050    
051                    attributes.put("pluginSettingId", getPluginSettingId());
052                    attributes.put("companyId", getCompanyId());
053                    attributes.put("pluginId", getPluginId());
054                    attributes.put("pluginType", getPluginType());
055                    attributes.put("roles", getRoles());
056                    attributes.put("active", getActive());
057    
058                    return attributes;
059            }
060    
061            @Override
062            public void setModelAttributes(Map<String, Object> attributes) {
063                    Long pluginSettingId = (Long)attributes.get("pluginSettingId");
064    
065                    if (pluginSettingId != null) {
066                            setPluginSettingId(pluginSettingId);
067                    }
068    
069                    Long companyId = (Long)attributes.get("companyId");
070    
071                    if (companyId != null) {
072                            setCompanyId(companyId);
073                    }
074    
075                    String pluginId = (String)attributes.get("pluginId");
076    
077                    if (pluginId != null) {
078                            setPluginId(pluginId);
079                    }
080    
081                    String pluginType = (String)attributes.get("pluginType");
082    
083                    if (pluginType != null) {
084                            setPluginType(pluginType);
085                    }
086    
087                    String roles = (String)attributes.get("roles");
088    
089                    if (roles != null) {
090                            setRoles(roles);
091                    }
092    
093                    Boolean active = (Boolean)attributes.get("active");
094    
095                    if (active != null) {
096                            setActive(active);
097                    }
098            }
099    
100            /**
101            * Returns the primary key of this plugin setting.
102            *
103            * @return the primary key of this plugin setting
104            */
105            @Override
106            public long getPrimaryKey() {
107                    return _pluginSetting.getPrimaryKey();
108            }
109    
110            /**
111            * Sets the primary key of this plugin setting.
112            *
113            * @param primaryKey the primary key of this plugin setting
114            */
115            @Override
116            public void setPrimaryKey(long primaryKey) {
117                    _pluginSetting.setPrimaryKey(primaryKey);
118            }
119    
120            /**
121            * Returns the plugin setting ID of this plugin setting.
122            *
123            * @return the plugin setting ID of this plugin setting
124            */
125            @Override
126            public long getPluginSettingId() {
127                    return _pluginSetting.getPluginSettingId();
128            }
129    
130            /**
131            * Sets the plugin setting ID of this plugin setting.
132            *
133            * @param pluginSettingId the plugin setting ID of this plugin setting
134            */
135            @Override
136            public void setPluginSettingId(long pluginSettingId) {
137                    _pluginSetting.setPluginSettingId(pluginSettingId);
138            }
139    
140            /**
141            * Returns the company ID of this plugin setting.
142            *
143            * @return the company ID of this plugin setting
144            */
145            @Override
146            public long getCompanyId() {
147                    return _pluginSetting.getCompanyId();
148            }
149    
150            /**
151            * Sets the company ID of this plugin setting.
152            *
153            * @param companyId the company ID of this plugin setting
154            */
155            @Override
156            public void setCompanyId(long companyId) {
157                    _pluginSetting.setCompanyId(companyId);
158            }
159    
160            /**
161            * Returns the plugin ID of this plugin setting.
162            *
163            * @return the plugin ID of this plugin setting
164            */
165            @Override
166            public java.lang.String getPluginId() {
167                    return _pluginSetting.getPluginId();
168            }
169    
170            /**
171            * Sets the plugin ID of this plugin setting.
172            *
173            * @param pluginId the plugin ID of this plugin setting
174            */
175            @Override
176            public void setPluginId(java.lang.String pluginId) {
177                    _pluginSetting.setPluginId(pluginId);
178            }
179    
180            /**
181            * Returns the plugin type of this plugin setting.
182            *
183            * @return the plugin type of this plugin setting
184            */
185            @Override
186            public java.lang.String getPluginType() {
187                    return _pluginSetting.getPluginType();
188            }
189    
190            /**
191            * Sets the plugin type of this plugin setting.
192            *
193            * @param pluginType the plugin type of this plugin setting
194            */
195            @Override
196            public void setPluginType(java.lang.String pluginType) {
197                    _pluginSetting.setPluginType(pluginType);
198            }
199    
200            /**
201            * Returns the roles of this plugin setting.
202            *
203            * @return the roles of this plugin setting
204            */
205            @Override
206            public java.lang.String getRoles() {
207                    return _pluginSetting.getRoles();
208            }
209    
210            /**
211            * Sets the roles of this plugin setting.
212            *
213            * @param roles the roles of this plugin setting
214            */
215            @Override
216            public void setRoles(java.lang.String roles) {
217                    _pluginSetting.setRoles(roles);
218            }
219    
220            /**
221            * Returns the active of this plugin setting.
222            *
223            * @return the active of this plugin setting
224            */
225            @Override
226            public boolean getActive() {
227                    return _pluginSetting.getActive();
228            }
229    
230            /**
231            * Returns <code>true</code> if this plugin setting is active.
232            *
233            * @return <code>true</code> if this plugin setting is active; <code>false</code> otherwise
234            */
235            @Override
236            public boolean isActive() {
237                    return _pluginSetting.isActive();
238            }
239    
240            /**
241            * Sets whether this plugin setting is active.
242            *
243            * @param active the active of this plugin setting
244            */
245            @Override
246            public void setActive(boolean active) {
247                    _pluginSetting.setActive(active);
248            }
249    
250            @Override
251            public boolean isNew() {
252                    return _pluginSetting.isNew();
253            }
254    
255            @Override
256            public void setNew(boolean n) {
257                    _pluginSetting.setNew(n);
258            }
259    
260            @Override
261            public boolean isCachedModel() {
262                    return _pluginSetting.isCachedModel();
263            }
264    
265            @Override
266            public void setCachedModel(boolean cachedModel) {
267                    _pluginSetting.setCachedModel(cachedModel);
268            }
269    
270            @Override
271            public boolean isEscapedModel() {
272                    return _pluginSetting.isEscapedModel();
273            }
274    
275            @Override
276            public java.io.Serializable getPrimaryKeyObj() {
277                    return _pluginSetting.getPrimaryKeyObj();
278            }
279    
280            @Override
281            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
282                    _pluginSetting.setPrimaryKeyObj(primaryKeyObj);
283            }
284    
285            @Override
286            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
287                    return _pluginSetting.getExpandoBridge();
288            }
289    
290            @Override
291            public void setExpandoBridgeAttributes(
292                    com.liferay.portal.model.BaseModel<?> baseModel) {
293                    _pluginSetting.setExpandoBridgeAttributes(baseModel);
294            }
295    
296            @Override
297            public void setExpandoBridgeAttributes(
298                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
299                    _pluginSetting.setExpandoBridgeAttributes(expandoBridge);
300            }
301    
302            @Override
303            public void setExpandoBridgeAttributes(
304                    com.liferay.portal.service.ServiceContext serviceContext) {
305                    _pluginSetting.setExpandoBridgeAttributes(serviceContext);
306            }
307    
308            @Override
309            public java.lang.Object clone() {
310                    return new PluginSettingWrapper((PluginSetting)_pluginSetting.clone());
311            }
312    
313            @Override
314            public int compareTo(com.liferay.portal.model.PluginSetting pluginSetting) {
315                    return _pluginSetting.compareTo(pluginSetting);
316            }
317    
318            @Override
319            public int hashCode() {
320                    return _pluginSetting.hashCode();
321            }
322    
323            @Override
324            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.PluginSetting> toCacheModel() {
325                    return _pluginSetting.toCacheModel();
326            }
327    
328            @Override
329            public com.liferay.portal.model.PluginSetting toEscapedModel() {
330                    return new PluginSettingWrapper(_pluginSetting.toEscapedModel());
331            }
332    
333            @Override
334            public com.liferay.portal.model.PluginSetting toUnescapedModel() {
335                    return new PluginSettingWrapper(_pluginSetting.toUnescapedModel());
336            }
337    
338            @Override
339            public java.lang.String toString() {
340                    return _pluginSetting.toString();
341            }
342    
343            @Override
344            public java.lang.String toXmlString() {
345                    return _pluginSetting.toXmlString();
346            }
347    
348            @Override
349            public void persist()
350                    throws com.liferay.portal.kernel.exception.SystemException {
351                    _pluginSetting.persist();
352            }
353    
354            /**
355            * Adds a role to the list of roles.
356            */
357            @Override
358            public void addRole(java.lang.String role) {
359                    _pluginSetting.addRole(role);
360            }
361    
362            /**
363            * Returns an array of required roles of the plugin.
364            *
365            * @return an array of required roles of the plugin
366            */
367            @Override
368            public java.lang.String[] getRolesArray() {
369                    return _pluginSetting.getRolesArray();
370            }
371    
372            /**
373            * Returns <code>true</code> if the user has permission to use this plugin
374            *
375            * @param userId the primary key of the user
376            * @return <code>true</code> if the user has permission to use this plugin
377            */
378            @Override
379            public boolean hasPermission(long userId) {
380                    return _pluginSetting.hasPermission(userId);
381            }
382    
383            /**
384            * Returns <code>true</code> if the plugin has a role with the specified
385            * name.
386            *
387            * @param roleName the role name
388            * @return <code>true</code> if the plugin has a role with the specified
389            name
390            */
391            @Override
392            public boolean hasRoleWithName(java.lang.String roleName) {
393                    return _pluginSetting.hasRoleWithName(roleName);
394            }
395    
396            /**
397            * Sets an array of required roles of the plugin.
398            */
399            @Override
400            public void setRolesArray(java.lang.String[] rolesArray) {
401                    _pluginSetting.setRolesArray(rolesArray);
402            }
403    
404            @Override
405            public boolean equals(Object obj) {
406                    if (this == obj) {
407                            return true;
408                    }
409    
410                    if (!(obj instanceof PluginSettingWrapper)) {
411                            return false;
412                    }
413    
414                    PluginSettingWrapper pluginSettingWrapper = (PluginSettingWrapper)obj;
415    
416                    if (Validator.equals(_pluginSetting, pluginSettingWrapper._pluginSetting)) {
417                            return true;
418                    }
419    
420                    return false;
421            }
422    
423            /**
424             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
425             */
426            public PluginSetting getWrappedPluginSetting() {
427                    return _pluginSetting;
428            }
429    
430            @Override
431            public PluginSetting getWrappedModel() {
432                    return _pluginSetting;
433            }
434    
435            @Override
436            public void resetOriginalValues() {
437                    _pluginSetting.resetOriginalValues();
438            }
439    
440            private PluginSetting _pluginSetting;
441    }