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(
314                    com.liferay.portal.model.BaseModel<?> baseModel) {
315                    _pluginSetting.setExpandoBridgeAttributes(baseModel);
316            }
317    
318            @Override
319            public void setExpandoBridgeAttributes(
320                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
321                    _pluginSetting.setExpandoBridgeAttributes(expandoBridge);
322            }
323    
324            @Override
325            public void setExpandoBridgeAttributes(
326                    com.liferay.portal.service.ServiceContext serviceContext) {
327                    _pluginSetting.setExpandoBridgeAttributes(serviceContext);
328            }
329    
330            /**
331            * Sets the mvcc version of this plugin setting.
332            *
333            * @param mvccVersion the mvcc version of this plugin setting
334            */
335            @Override
336            public void setMvccVersion(long mvccVersion) {
337                    _pluginSetting.setMvccVersion(mvccVersion);
338            }
339    
340            @Override
341            public void setNew(boolean n) {
342                    _pluginSetting.setNew(n);
343            }
344    
345            /**
346            * Sets the plugin ID of this plugin setting.
347            *
348            * @param pluginId the plugin ID of this plugin setting
349            */
350            @Override
351            public void setPluginId(java.lang.String pluginId) {
352                    _pluginSetting.setPluginId(pluginId);
353            }
354    
355            /**
356            * Sets the plugin setting ID of this plugin setting.
357            *
358            * @param pluginSettingId the plugin setting ID of this plugin setting
359            */
360            @Override
361            public void setPluginSettingId(long pluginSettingId) {
362                    _pluginSetting.setPluginSettingId(pluginSettingId);
363            }
364    
365            /**
366            * Sets the plugin type of this plugin setting.
367            *
368            * @param pluginType the plugin type of this plugin setting
369            */
370            @Override
371            public void setPluginType(java.lang.String pluginType) {
372                    _pluginSetting.setPluginType(pluginType);
373            }
374    
375            /**
376            * Sets the primary key of this plugin setting.
377            *
378            * @param primaryKey the primary key of this plugin setting
379            */
380            @Override
381            public void setPrimaryKey(long primaryKey) {
382                    _pluginSetting.setPrimaryKey(primaryKey);
383            }
384    
385            @Override
386            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
387                    _pluginSetting.setPrimaryKeyObj(primaryKeyObj);
388            }
389    
390            /**
391            * Sets the roles of this plugin setting.
392            *
393            * @param roles the roles of this plugin setting
394            */
395            @Override
396            public void setRoles(java.lang.String roles) {
397                    _pluginSetting.setRoles(roles);
398            }
399    
400            /**
401            * Sets an array of required roles of the plugin.
402            */
403            @Override
404            public void setRolesArray(java.lang.String[] rolesArray) {
405                    _pluginSetting.setRolesArray(rolesArray);
406            }
407    
408            @Override
409            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.PluginSetting> toCacheModel() {
410                    return _pluginSetting.toCacheModel();
411            }
412    
413            @Override
414            public com.liferay.portal.model.PluginSetting toEscapedModel() {
415                    return new PluginSettingWrapper(_pluginSetting.toEscapedModel());
416            }
417    
418            @Override
419            public java.lang.String toString() {
420                    return _pluginSetting.toString();
421            }
422    
423            @Override
424            public com.liferay.portal.model.PluginSetting toUnescapedModel() {
425                    return new PluginSettingWrapper(_pluginSetting.toUnescapedModel());
426            }
427    
428            @Override
429            public java.lang.String toXmlString() {
430                    return _pluginSetting.toXmlString();
431            }
432    
433            @Override
434            public boolean equals(Object obj) {
435                    if (this == obj) {
436                            return true;
437                    }
438    
439                    if (!(obj instanceof PluginSettingWrapper)) {
440                            return false;
441                    }
442    
443                    PluginSettingWrapper pluginSettingWrapper = (PluginSettingWrapper)obj;
444    
445                    if (Validator.equals(_pluginSetting, pluginSettingWrapper._pluginSetting)) {
446                            return true;
447                    }
448    
449                    return false;
450            }
451    
452            /**
453             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
454             */
455            @Deprecated
456            public PluginSetting getWrappedPluginSetting() {
457                    return _pluginSetting;
458            }
459    
460            @Override
461            public PluginSetting getWrappedModel() {
462                    return _pluginSetting;
463            }
464    
465            @Override
466            public boolean isEntityCacheEnabled() {
467                    return _pluginSetting.isEntityCacheEnabled();
468            }
469    
470            @Override
471            public boolean isFinderCacheEnabled() {
472                    return _pluginSetting.isFinderCacheEnabled();
473            }
474    
475            @Override
476            public void resetOriginalValues() {
477                    _pluginSetting.resetOriginalValues();
478            }
479    
480            private final PluginSetting _pluginSetting;
481    }