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