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    
023    import java.io.Serializable;
024    
025    import java.util.HashMap;
026    import java.util.Map;
027    import java.util.Objects;
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 CacheModel<ResourceTypePermission> toCacheModel() {
119                    return _resourceTypePermission.toCacheModel();
120            }
121    
122            @Override
123            public ResourceTypePermission toEscapedModel() {
124                    return new ResourceTypePermissionWrapper(_resourceTypePermission.toEscapedModel());
125            }
126    
127            @Override
128            public ResourceTypePermission toUnescapedModel() {
129                    return new ResourceTypePermissionWrapper(_resourceTypePermission.toUnescapedModel());
130            }
131    
132            @Override
133            public boolean hasAction(ResourceAction resourceAction) {
134                    return _resourceTypePermission.hasAction(resourceAction);
135            }
136    
137            @Override
138            public boolean isCachedModel() {
139                    return _resourceTypePermission.isCachedModel();
140            }
141    
142            @Override
143            public boolean isCompanyScope() {
144                    return _resourceTypePermission.isCompanyScope();
145            }
146    
147            @Override
148            public boolean isEscapedModel() {
149                    return _resourceTypePermission.isEscapedModel();
150            }
151    
152            @Override
153            public boolean isGroupScope() {
154                    return _resourceTypePermission.isGroupScope();
155            }
156    
157            @Override
158            public boolean isNew() {
159                    return _resourceTypePermission.isNew();
160            }
161    
162            @Override
163            public ExpandoBridge getExpandoBridge() {
164                    return _resourceTypePermission.getExpandoBridge();
165            }
166    
167            @Override
168            public int compareTo(ResourceTypePermission resourceTypePermission) {
169                    return _resourceTypePermission.compareTo(resourceTypePermission);
170            }
171    
172            @Override
173            public int hashCode() {
174                    return _resourceTypePermission.hashCode();
175            }
176    
177            @Override
178            public Serializable getPrimaryKeyObj() {
179                    return _resourceTypePermission.getPrimaryKeyObj();
180            }
181    
182            @Override
183            public java.lang.Object clone() {
184                    return new ResourceTypePermissionWrapper((ResourceTypePermission)_resourceTypePermission.clone());
185            }
186    
187            /**
188            * Returns the name of this resource type permission.
189            *
190            * @return the name of this resource type permission
191            */
192            @Override
193            public java.lang.String getName() {
194                    return _resourceTypePermission.getName();
195            }
196    
197            @Override
198            public java.lang.String toString() {
199                    return _resourceTypePermission.toString();
200            }
201    
202            @Override
203            public java.lang.String toXmlString() {
204                    return _resourceTypePermission.toXmlString();
205            }
206    
207            /**
208            * Returns the action IDs of this resource type permission.
209            *
210            * @return the action IDs of this resource type permission
211            */
212            @Override
213            public long getActionIds() {
214                    return _resourceTypePermission.getActionIds();
215            }
216    
217            /**
218            * Returns the company ID of this resource type permission.
219            *
220            * @return the company ID of this resource type permission
221            */
222            @Override
223            public long getCompanyId() {
224                    return _resourceTypePermission.getCompanyId();
225            }
226    
227            /**
228            * Returns the group ID of this resource type permission.
229            *
230            * @return the group ID of this resource type permission
231            */
232            @Override
233            public long getGroupId() {
234                    return _resourceTypePermission.getGroupId();
235            }
236    
237            /**
238            * Returns the mvcc version of this resource type permission.
239            *
240            * @return the mvcc version of this resource type permission
241            */
242            @Override
243            public long getMvccVersion() {
244                    return _resourceTypePermission.getMvccVersion();
245            }
246    
247            /**
248            * Returns the primary key of this resource type permission.
249            *
250            * @return the primary key of this resource type permission
251            */
252            @Override
253            public long getPrimaryKey() {
254                    return _resourceTypePermission.getPrimaryKey();
255            }
256    
257            /**
258            * Returns the resource type permission ID of this resource type permission.
259            *
260            * @return the resource type permission ID of this resource type permission
261            */
262            @Override
263            public long getResourceTypePermissionId() {
264                    return _resourceTypePermission.getResourceTypePermissionId();
265            }
266    
267            /**
268            * Returns the role ID of this resource type permission.
269            *
270            * @return the role ID of this resource type permission
271            */
272            @Override
273            public long getRoleId() {
274                    return _resourceTypePermission.getRoleId();
275            }
276    
277            @Override
278            public void persist() {
279                    _resourceTypePermission.persist();
280            }
281    
282            /**
283            * Sets the action IDs of this resource type permission.
284            *
285            * @param actionIds the action IDs of this resource type permission
286            */
287            @Override
288            public void setActionIds(long actionIds) {
289                    _resourceTypePermission.setActionIds(actionIds);
290            }
291    
292            @Override
293            public void setCachedModel(boolean cachedModel) {
294                    _resourceTypePermission.setCachedModel(cachedModel);
295            }
296    
297            /**
298            * Sets the company ID of this resource type permission.
299            *
300            * @param companyId the company ID of this resource type permission
301            */
302            @Override
303            public void setCompanyId(long companyId) {
304                    _resourceTypePermission.setCompanyId(companyId);
305            }
306    
307            @Override
308            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
309                    _resourceTypePermission.setExpandoBridgeAttributes(baseModel);
310            }
311    
312            @Override
313            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
314                    _resourceTypePermission.setExpandoBridgeAttributes(expandoBridge);
315            }
316    
317            @Override
318            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
319                    _resourceTypePermission.setExpandoBridgeAttributes(serviceContext);
320            }
321    
322            /**
323            * Sets the group ID of this resource type permission.
324            *
325            * @param groupId the group ID of this resource type permission
326            */
327            @Override
328            public void setGroupId(long groupId) {
329                    _resourceTypePermission.setGroupId(groupId);
330            }
331    
332            /**
333            * Sets the mvcc version of this resource type permission.
334            *
335            * @param mvccVersion the mvcc version of this resource type permission
336            */
337            @Override
338            public void setMvccVersion(long mvccVersion) {
339                    _resourceTypePermission.setMvccVersion(mvccVersion);
340            }
341    
342            /**
343            * Sets the name of this resource type permission.
344            *
345            * @param name the name of this resource type permission
346            */
347            @Override
348            public void setName(java.lang.String name) {
349                    _resourceTypePermission.setName(name);
350            }
351    
352            @Override
353            public void setNew(boolean n) {
354                    _resourceTypePermission.setNew(n);
355            }
356    
357            /**
358            * Sets the primary key of this resource type permission.
359            *
360            * @param primaryKey the primary key of this resource type permission
361            */
362            @Override
363            public void setPrimaryKey(long primaryKey) {
364                    _resourceTypePermission.setPrimaryKey(primaryKey);
365            }
366    
367            @Override
368            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
369                    _resourceTypePermission.setPrimaryKeyObj(primaryKeyObj);
370            }
371    
372            /**
373            * Sets the resource type permission ID of this resource type permission.
374            *
375            * @param resourceTypePermissionId the resource type permission ID of this resource type permission
376            */
377            @Override
378            public void setResourceTypePermissionId(long resourceTypePermissionId) {
379                    _resourceTypePermission.setResourceTypePermissionId(resourceTypePermissionId);
380            }
381    
382            /**
383            * Sets the role ID of this resource type permission.
384            *
385            * @param roleId the role ID of this resource type permission
386            */
387            @Override
388            public void setRoleId(long roleId) {
389                    _resourceTypePermission.setRoleId(roleId);
390            }
391    
392            @Override
393            public boolean equals(Object obj) {
394                    if (this == obj) {
395                            return true;
396                    }
397    
398                    if (!(obj instanceof ResourceTypePermissionWrapper)) {
399                            return false;
400                    }
401    
402                    ResourceTypePermissionWrapper resourceTypePermissionWrapper = (ResourceTypePermissionWrapper)obj;
403    
404                    if (Objects.equals(_resourceTypePermission,
405                                            resourceTypePermissionWrapper._resourceTypePermission)) {
406                            return true;
407                    }
408    
409                    return false;
410            }
411    
412            @Override
413            public ResourceTypePermission getWrappedModel() {
414                    return _resourceTypePermission;
415            }
416    
417            @Override
418            public boolean isEntityCacheEnabled() {
419                    return _resourceTypePermission.isEntityCacheEnabled();
420            }
421    
422            @Override
423            public boolean isFinderCacheEnabled() {
424                    return _resourceTypePermission.isFinderCacheEnabled();
425            }
426    
427            @Override
428            public void resetOriginalValues() {
429                    _resourceTypePermission.resetOriginalValues();
430            }
431    
432            private final ResourceTypePermission _resourceTypePermission;
433    }