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