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