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