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