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 int hashCode() {
215                    return _resourceTypePermission.hashCode();
216            }
217    
218            @Override
219            public boolean isCachedModel() {
220                    return _resourceTypePermission.isCachedModel();
221            }
222    
223            @Override
224            public boolean isCompanyScope() {
225                    return _resourceTypePermission.isCompanyScope();
226            }
227    
228            @Override
229            public boolean isEscapedModel() {
230                    return _resourceTypePermission.isEscapedModel();
231            }
232    
233            @Override
234            public boolean isGroupScope() {
235                    return _resourceTypePermission.isGroupScope();
236            }
237    
238            @Override
239            public boolean isNew() {
240                    return _resourceTypePermission.isNew();
241            }
242    
243            @Override
244            public void persist() {
245                    _resourceTypePermission.persist();
246            }
247    
248            /**
249            * Sets the action IDs of this resource type permission.
250            *
251            * @param actionIds the action IDs of this resource type permission
252            */
253            @Override
254            public void setActionIds(long actionIds) {
255                    _resourceTypePermission.setActionIds(actionIds);
256            }
257    
258            @Override
259            public void setCachedModel(boolean cachedModel) {
260                    _resourceTypePermission.setCachedModel(cachedModel);
261            }
262    
263            /**
264            * Sets the company ID of this resource type permission.
265            *
266            * @param companyId the company ID of this resource type permission
267            */
268            @Override
269            public void setCompanyId(long companyId) {
270                    _resourceTypePermission.setCompanyId(companyId);
271            }
272    
273            @Override
274            public void setExpandoBridgeAttributes(
275                    com.liferay.portal.model.BaseModel<?> baseModel) {
276                    _resourceTypePermission.setExpandoBridgeAttributes(baseModel);
277            }
278    
279            @Override
280            public void setExpandoBridgeAttributes(
281                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
282                    _resourceTypePermission.setExpandoBridgeAttributes(expandoBridge);
283            }
284    
285            @Override
286            public void setExpandoBridgeAttributes(
287                    com.liferay.portal.service.ServiceContext serviceContext) {
288                    _resourceTypePermission.setExpandoBridgeAttributes(serviceContext);
289            }
290    
291            /**
292            * Sets the group ID of this resource type permission.
293            *
294            * @param groupId the group ID of this resource type permission
295            */
296            @Override
297            public void setGroupId(long groupId) {
298                    _resourceTypePermission.setGroupId(groupId);
299            }
300    
301            /**
302            * Sets the mvcc version of this resource type permission.
303            *
304            * @param mvccVersion the mvcc version of this resource type permission
305            */
306            @Override
307            public void setMvccVersion(long mvccVersion) {
308                    _resourceTypePermission.setMvccVersion(mvccVersion);
309            }
310    
311            /**
312            * Sets the name of this resource type permission.
313            *
314            * @param name the name of this resource type permission
315            */
316            @Override
317            public void setName(java.lang.String name) {
318                    _resourceTypePermission.setName(name);
319            }
320    
321            @Override
322            public void setNew(boolean n) {
323                    _resourceTypePermission.setNew(n);
324            }
325    
326            /**
327            * Sets the primary key of this resource type permission.
328            *
329            * @param primaryKey the primary key of this resource type permission
330            */
331            @Override
332            public void setPrimaryKey(long primaryKey) {
333                    _resourceTypePermission.setPrimaryKey(primaryKey);
334            }
335    
336            @Override
337            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
338                    _resourceTypePermission.setPrimaryKeyObj(primaryKeyObj);
339            }
340    
341            /**
342            * Sets the resource type permission ID of this resource type permission.
343            *
344            * @param resourceTypePermissionId the resource type permission ID of this resource type permission
345            */
346            @Override
347            public void setResourceTypePermissionId(long resourceTypePermissionId) {
348                    _resourceTypePermission.setResourceTypePermissionId(resourceTypePermissionId);
349            }
350    
351            /**
352            * Sets the role ID of this resource type permission.
353            *
354            * @param roleId the role ID of this resource type permission
355            */
356            @Override
357            public void setRoleId(long roleId) {
358                    _resourceTypePermission.setRoleId(roleId);
359            }
360    
361            @Override
362            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.ResourceTypePermission> toCacheModel() {
363                    return _resourceTypePermission.toCacheModel();
364            }
365    
366            @Override
367            public com.liferay.portal.model.ResourceTypePermission toEscapedModel() {
368                    return new ResourceTypePermissionWrapper(_resourceTypePermission.toEscapedModel());
369            }
370    
371            @Override
372            public java.lang.String toString() {
373                    return _resourceTypePermission.toString();
374            }
375    
376            @Override
377            public com.liferay.portal.model.ResourceTypePermission toUnescapedModel() {
378                    return new ResourceTypePermissionWrapper(_resourceTypePermission.toUnescapedModel());
379            }
380    
381            @Override
382            public java.lang.String toXmlString() {
383                    return _resourceTypePermission.toXmlString();
384            }
385    
386            @Override
387            public boolean equals(Object obj) {
388                    if (this == obj) {
389                            return true;
390                    }
391    
392                    if (!(obj instanceof ResourceTypePermissionWrapper)) {
393                            return false;
394                    }
395    
396                    ResourceTypePermissionWrapper resourceTypePermissionWrapper = (ResourceTypePermissionWrapper)obj;
397    
398                    if (Validator.equals(_resourceTypePermission,
399                                            resourceTypePermissionWrapper._resourceTypePermission)) {
400                            return true;
401                    }
402    
403                    return false;
404            }
405    
406            /**
407             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
408             */
409            @Deprecated
410            public ResourceTypePermission getWrappedResourceTypePermission() {
411                    return _resourceTypePermission;
412            }
413    
414            @Override
415            public ResourceTypePermission getWrappedModel() {
416                    return _resourceTypePermission;
417            }
418    
419            @Override
420            public boolean isEntityCacheEnabled() {
421                    return _resourceTypePermission.isEntityCacheEnabled();
422            }
423    
424            @Override
425            public boolean isFinderCacheEnabled() {
426                    return _resourceTypePermission.isFinderCacheEnabled();
427            }
428    
429            @Override
430            public void resetOriginalValues() {
431                    _resourceTypePermission.resetOriginalValues();
432            }
433    
434            private final ResourceTypePermission _resourceTypePermission;
435    }