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