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