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