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