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