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