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.kernel.model;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.expando.kernel.model.ExpandoBridge;
020    
021    import com.liferay.portal.kernel.service.ServiceContext;
022    import com.liferay.portal.kernel.util.Validator;
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(
130                    com.liferay.portal.kernel.model.PluginSetting pluginSetting) {
131                    return _pluginSetting.compareTo(pluginSetting);
132            }
133    
134            /**
135            * Returns the active of this plugin setting.
136            *
137            * @return the active of this plugin setting
138            */
139            @Override
140            public boolean getActive() {
141                    return _pluginSetting.getActive();
142            }
143    
144            /**
145            * Returns the company ID of this plugin setting.
146            *
147            * @return the company ID of this plugin setting
148            */
149            @Override
150            public long getCompanyId() {
151                    return _pluginSetting.getCompanyId();
152            }
153    
154            @Override
155            public ExpandoBridge getExpandoBridge() {
156                    return _pluginSetting.getExpandoBridge();
157            }
158    
159            /**
160            * Returns the mvcc version of this plugin setting.
161            *
162            * @return the mvcc version of this plugin setting
163            */
164            @Override
165            public long getMvccVersion() {
166                    return _pluginSetting.getMvccVersion();
167            }
168    
169            /**
170            * Returns the plugin ID of this plugin setting.
171            *
172            * @return the plugin ID of this plugin setting
173            */
174            @Override
175            public java.lang.String getPluginId() {
176                    return _pluginSetting.getPluginId();
177            }
178    
179            /**
180            * Returns the plugin setting ID of this plugin setting.
181            *
182            * @return the plugin setting ID of this plugin setting
183            */
184            @Override
185            public long getPluginSettingId() {
186                    return _pluginSetting.getPluginSettingId();
187            }
188    
189            /**
190            * Returns the plugin type of this plugin setting.
191            *
192            * @return the plugin type of this plugin setting
193            */
194            @Override
195            public java.lang.String getPluginType() {
196                    return _pluginSetting.getPluginType();
197            }
198    
199            /**
200            * Returns the primary key of this plugin setting.
201            *
202            * @return the primary key of this plugin setting
203            */
204            @Override
205            public long getPrimaryKey() {
206                    return _pluginSetting.getPrimaryKey();
207            }
208    
209            @Override
210            public Serializable getPrimaryKeyObj() {
211                    return _pluginSetting.getPrimaryKeyObj();
212            }
213    
214            /**
215            * Returns the roles of this plugin setting.
216            *
217            * @return the roles of this plugin setting
218            */
219            @Override
220            public java.lang.String getRoles() {
221                    return _pluginSetting.getRoles();
222            }
223    
224            /**
225            * Returns an array of required roles of the plugin.
226            *
227            * @return an array of required roles of the plugin
228            */
229            @Override
230            public java.lang.String[] getRolesArray() {
231                    return _pluginSetting.getRolesArray();
232            }
233    
234            /**
235            * Returns <code>true</code> if the user has permission to use this plugin
236            *
237            * @param userId the primary key of the user
238            * @return <code>true</code> if the user has permission to use this plugin
239            */
240            @Override
241            public boolean hasPermission(long userId) {
242                    return _pluginSetting.hasPermission(userId);
243            }
244    
245            /**
246            * Returns <code>true</code> if the plugin has a role with the specified
247            * name.
248            *
249            * @param roleName the role name
250            * @return <code>true</code> if the plugin has a role with the specified
251            name
252            */
253            @Override
254            public boolean hasRoleWithName(java.lang.String roleName) {
255                    return _pluginSetting.hasRoleWithName(roleName);
256            }
257    
258            @Override
259            public int hashCode() {
260                    return _pluginSetting.hashCode();
261            }
262    
263            /**
264            * Returns <code>true</code> if this plugin setting is active.
265            *
266            * @return <code>true</code> if this plugin setting is active; <code>false</code> otherwise
267            */
268            @Override
269            public boolean isActive() {
270                    return _pluginSetting.isActive();
271            }
272    
273            @Override
274            public boolean isCachedModel() {
275                    return _pluginSetting.isCachedModel();
276            }
277    
278            @Override
279            public boolean isEscapedModel() {
280                    return _pluginSetting.isEscapedModel();
281            }
282    
283            @Override
284            public boolean isNew() {
285                    return _pluginSetting.isNew();
286            }
287    
288            @Override
289            public void persist() {
290                    _pluginSetting.persist();
291            }
292    
293            /**
294            * Sets whether this plugin setting is active.
295            *
296            * @param active the active of this plugin setting
297            */
298            @Override
299            public void setActive(boolean active) {
300                    _pluginSetting.setActive(active);
301            }
302    
303            @Override
304            public void setCachedModel(boolean cachedModel) {
305                    _pluginSetting.setCachedModel(cachedModel);
306            }
307    
308            /**
309            * Sets the company ID of this plugin setting.
310            *
311            * @param companyId the company ID of this plugin setting
312            */
313            @Override
314            public void setCompanyId(long companyId) {
315                    _pluginSetting.setCompanyId(companyId);
316            }
317    
318            @Override
319            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
320                    _pluginSetting.setExpandoBridgeAttributes(baseModel);
321            }
322    
323            @Override
324            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
325                    _pluginSetting.setExpandoBridgeAttributes(expandoBridge);
326            }
327    
328            @Override
329            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
330                    _pluginSetting.setExpandoBridgeAttributes(serviceContext);
331            }
332    
333            /**
334            * Sets the mvcc version of this plugin setting.
335            *
336            * @param mvccVersion the mvcc version of this plugin setting
337            */
338            @Override
339            public void setMvccVersion(long mvccVersion) {
340                    _pluginSetting.setMvccVersion(mvccVersion);
341            }
342    
343            @Override
344            public void setNew(boolean n) {
345                    _pluginSetting.setNew(n);
346            }
347    
348            /**
349            * Sets the plugin ID of this plugin setting.
350            *
351            * @param pluginId the plugin ID of this plugin setting
352            */
353            @Override
354            public void setPluginId(java.lang.String pluginId) {
355                    _pluginSetting.setPluginId(pluginId);
356            }
357    
358            /**
359            * Sets the plugin setting ID of this plugin setting.
360            *
361            * @param pluginSettingId the plugin setting ID of this plugin setting
362            */
363            @Override
364            public void setPluginSettingId(long pluginSettingId) {
365                    _pluginSetting.setPluginSettingId(pluginSettingId);
366            }
367    
368            /**
369            * Sets the plugin type of this plugin setting.
370            *
371            * @param pluginType the plugin type of this plugin setting
372            */
373            @Override
374            public void setPluginType(java.lang.String pluginType) {
375                    _pluginSetting.setPluginType(pluginType);
376            }
377    
378            /**
379            * Sets the primary key of this plugin setting.
380            *
381            * @param primaryKey the primary key of this plugin setting
382            */
383            @Override
384            public void setPrimaryKey(long primaryKey) {
385                    _pluginSetting.setPrimaryKey(primaryKey);
386            }
387    
388            @Override
389            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
390                    _pluginSetting.setPrimaryKeyObj(primaryKeyObj);
391            }
392    
393            /**
394            * Sets the roles of this plugin setting.
395            *
396            * @param roles the roles of this plugin setting
397            */
398            @Override
399            public void setRoles(java.lang.String roles) {
400                    _pluginSetting.setRoles(roles);
401            }
402    
403            /**
404            * Sets an array of required roles of the plugin.
405            */
406            @Override
407            public void setRolesArray(java.lang.String[] rolesArray) {
408                    _pluginSetting.setRolesArray(rolesArray);
409            }
410    
411            @Override
412            public CacheModel<com.liferay.portal.kernel.model.PluginSetting> toCacheModel() {
413                    return _pluginSetting.toCacheModel();
414            }
415    
416            @Override
417            public com.liferay.portal.kernel.model.PluginSetting toEscapedModel() {
418                    return new PluginSettingWrapper(_pluginSetting.toEscapedModel());
419            }
420    
421            @Override
422            public java.lang.String toString() {
423                    return _pluginSetting.toString();
424            }
425    
426            @Override
427            public com.liferay.portal.kernel.model.PluginSetting toUnescapedModel() {
428                    return new PluginSettingWrapper(_pluginSetting.toUnescapedModel());
429            }
430    
431            @Override
432            public java.lang.String toXmlString() {
433                    return _pluginSetting.toXmlString();
434            }
435    
436            @Override
437            public boolean equals(Object obj) {
438                    if (this == obj) {
439                            return true;
440                    }
441    
442                    if (!(obj instanceof PluginSettingWrapper)) {
443                            return false;
444                    }
445    
446                    PluginSettingWrapper pluginSettingWrapper = (PluginSettingWrapper)obj;
447    
448                    if (Validator.equals(_pluginSetting, pluginSettingWrapper._pluginSetting)) {
449                            return true;
450                    }
451    
452                    return false;
453            }
454    
455            @Override
456            public PluginSetting getWrappedModel() {
457                    return _pluginSetting;
458            }
459    
460            @Override
461            public boolean isEntityCacheEnabled() {
462                    return _pluginSetting.isEntityCacheEnabled();
463            }
464    
465            @Override
466            public boolean isFinderCacheEnabled() {
467                    return _pluginSetting.isFinderCacheEnabled();
468            }
469    
470            @Override
471            public void resetOriginalValues() {
472                    _pluginSetting.resetOriginalValues();
473            }
474    
475            private final PluginSetting _pluginSetting;
476    }