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