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 java.lang.Object clone() {
126                    return new ResourcePermissionWrapper((ResourcePermission)_resourcePermission.clone());
127            }
128    
129            @Override
130            public int compareTo(
131                    com.liferay.portal.model.ResourcePermission resourcePermission) {
132                    return _resourcePermission.compareTo(resourcePermission);
133            }
134    
135            /**
136            * Returns the action IDs of this resource permission.
137            *
138            * @return the action IDs of this resource permission
139            */
140            @Override
141            public long getActionIds() {
142                    return _resourcePermission.getActionIds();
143            }
144    
145            /**
146            * Returns the company ID of this resource permission.
147            *
148            * @return the company ID of this resource permission
149            */
150            @Override
151            public long getCompanyId() {
152                    return _resourcePermission.getCompanyId();
153            }
154    
155            @Override
156            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
157                    return _resourcePermission.getExpandoBridge();
158            }
159    
160            /**
161            * Returns the mvcc version of this resource permission.
162            *
163            * @return the mvcc version of this resource permission
164            */
165            @Override
166            public long getMvccVersion() {
167                    return _resourcePermission.getMvccVersion();
168            }
169    
170            /**
171            * Returns the name of this resource permission.
172            *
173            * @return the name of this resource permission
174            */
175            @Override
176            public java.lang.String getName() {
177                    return _resourcePermission.getName();
178            }
179    
180            /**
181            * Returns the owner ID of this resource permission.
182            *
183            * @return the owner ID of this resource permission
184            */
185            @Override
186            public long getOwnerId() {
187                    return _resourcePermission.getOwnerId();
188            }
189    
190            /**
191            * Returns the prim key of this resource permission.
192            *
193            * @return the prim key of this resource permission
194            */
195            @Override
196            public java.lang.String getPrimKey() {
197                    return _resourcePermission.getPrimKey();
198            }
199    
200            /**
201            * Returns the primary key of this resource permission.
202            *
203            * @return the primary key of this resource permission
204            */
205            @Override
206            public long getPrimaryKey() {
207                    return _resourcePermission.getPrimaryKey();
208            }
209    
210            @Override
211            public java.io.Serializable getPrimaryKeyObj() {
212                    return _resourcePermission.getPrimaryKeyObj();
213            }
214    
215            /**
216            * Returns the resource permission ID of this resource permission.
217            *
218            * @return the resource permission ID of this resource permission
219            */
220            @Override
221            public long getResourcePermissionId() {
222                    return _resourcePermission.getResourcePermissionId();
223            }
224    
225            /**
226            * Returns the role ID of this resource permission.
227            *
228            * @return the role ID of this resource permission
229            */
230            @Override
231            public long getRoleId() {
232                    return _resourcePermission.getRoleId();
233            }
234    
235            /**
236            * Returns the scope of this resource permission.
237            *
238            * @return the scope of this resource permission
239            */
240            @Override
241            public int getScope() {
242                    return _resourcePermission.getScope();
243            }
244    
245            @Override
246            public boolean hasActionId(java.lang.String actionId) {
247                    return _resourcePermission.hasActionId(actionId);
248            }
249    
250            @Override
251            public int hashCode() {
252                    return _resourcePermission.hashCode();
253            }
254    
255            @Override
256            public boolean isCachedModel() {
257                    return _resourcePermission.isCachedModel();
258            }
259    
260            @Override
261            public boolean isEscapedModel() {
262                    return _resourcePermission.isEscapedModel();
263            }
264    
265            @Override
266            public boolean isNew() {
267                    return _resourcePermission.isNew();
268            }
269    
270            @Override
271            public void persist() {
272                    _resourcePermission.persist();
273            }
274    
275            /**
276            * Sets the action IDs of this resource permission.
277            *
278            * @param actionIds the action IDs of this resource permission
279            */
280            @Override
281            public void setActionIds(long actionIds) {
282                    _resourcePermission.setActionIds(actionIds);
283            }
284    
285            @Override
286            public void setCachedModel(boolean cachedModel) {
287                    _resourcePermission.setCachedModel(cachedModel);
288            }
289    
290            /**
291            * Sets the company ID of this resource permission.
292            *
293            * @param companyId the company ID of this resource permission
294            */
295            @Override
296            public void setCompanyId(long companyId) {
297                    _resourcePermission.setCompanyId(companyId);
298            }
299    
300            @Override
301            public void setExpandoBridgeAttributes(
302                    com.liferay.portal.model.BaseModel<?> baseModel) {
303                    _resourcePermission.setExpandoBridgeAttributes(baseModel);
304            }
305    
306            @Override
307            public void setExpandoBridgeAttributes(
308                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
309                    _resourcePermission.setExpandoBridgeAttributes(expandoBridge);
310            }
311    
312            @Override
313            public void setExpandoBridgeAttributes(
314                    com.liferay.portal.service.ServiceContext serviceContext) {
315                    _resourcePermission.setExpandoBridgeAttributes(serviceContext);
316            }
317    
318            /**
319            * Sets the mvcc version of this resource permission.
320            *
321            * @param mvccVersion the mvcc version of this resource permission
322            */
323            @Override
324            public void setMvccVersion(long mvccVersion) {
325                    _resourcePermission.setMvccVersion(mvccVersion);
326            }
327    
328            /**
329            * Sets the name of this resource permission.
330            *
331            * @param name the name of this resource permission
332            */
333            @Override
334            public void setName(java.lang.String name) {
335                    _resourcePermission.setName(name);
336            }
337    
338            @Override
339            public void setNew(boolean n) {
340                    _resourcePermission.setNew(n);
341            }
342    
343            /**
344            * Sets the owner ID of this resource permission.
345            *
346            * @param ownerId the owner ID of this resource permission
347            */
348            @Override
349            public void setOwnerId(long ownerId) {
350                    _resourcePermission.setOwnerId(ownerId);
351            }
352    
353            /**
354            * Sets the prim key of this resource permission.
355            *
356            * @param primKey the prim key of this resource permission
357            */
358            @Override
359            public void setPrimKey(java.lang.String primKey) {
360                    _resourcePermission.setPrimKey(primKey);
361            }
362    
363            /**
364            * Sets the primary key of this resource permission.
365            *
366            * @param primaryKey the primary key of this resource permission
367            */
368            @Override
369            public void setPrimaryKey(long primaryKey) {
370                    _resourcePermission.setPrimaryKey(primaryKey);
371            }
372    
373            @Override
374            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
375                    _resourcePermission.setPrimaryKeyObj(primaryKeyObj);
376            }
377    
378            /**
379            * Sets the resource permission ID of this resource permission.
380            *
381            * @param resourcePermissionId the resource permission ID of this resource permission
382            */
383            @Override
384            public void setResourcePermissionId(long resourcePermissionId) {
385                    _resourcePermission.setResourcePermissionId(resourcePermissionId);
386            }
387    
388            /**
389            * Sets the role ID of this resource permission.
390            *
391            * @param roleId the role ID of this resource permission
392            */
393            @Override
394            public void setRoleId(long roleId) {
395                    _resourcePermission.setRoleId(roleId);
396            }
397    
398            /**
399            * Sets the scope of this resource permission.
400            *
401            * @param scope the scope of this resource permission
402            */
403            @Override
404            public void setScope(int scope) {
405                    _resourcePermission.setScope(scope);
406            }
407    
408            @Override
409            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.ResourcePermission> toCacheModel() {
410                    return _resourcePermission.toCacheModel();
411            }
412    
413            @Override
414            public com.liferay.portal.model.ResourcePermission toEscapedModel() {
415                    return new ResourcePermissionWrapper(_resourcePermission.toEscapedModel());
416            }
417    
418            @Override
419            public java.lang.String toString() {
420                    return _resourcePermission.toString();
421            }
422    
423            @Override
424            public com.liferay.portal.model.ResourcePermission toUnescapedModel() {
425                    return new ResourcePermissionWrapper(_resourcePermission.toUnescapedModel());
426            }
427    
428            @Override
429            public java.lang.String toXmlString() {
430                    return _resourcePermission.toXmlString();
431            }
432    
433            @Override
434            public boolean equals(Object obj) {
435                    if (this == obj) {
436                            return true;
437                    }
438    
439                    if (!(obj instanceof ResourcePermissionWrapper)) {
440                            return false;
441                    }
442    
443                    ResourcePermissionWrapper resourcePermissionWrapper = (ResourcePermissionWrapper)obj;
444    
445                    if (Validator.equals(_resourcePermission,
446                                            resourcePermissionWrapper._resourcePermission)) {
447                            return true;
448                    }
449    
450                    return false;
451            }
452    
453            /**
454             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
455             */
456            @Deprecated
457            public ResourcePermission getWrappedResourcePermission() {
458                    return _resourcePermission;
459            }
460    
461            @Override
462            public ResourcePermission getWrappedModel() {
463                    return _resourcePermission;
464            }
465    
466            @Override
467            public boolean isEntityCacheEnabled() {
468                    return _resourcePermission.isEntityCacheEnabled();
469            }
470    
471            @Override
472            public boolean isFinderCacheEnabled() {
473                    return _resourcePermission.isFinderCacheEnabled();
474            }
475    
476            @Override
477            public void resetOriginalValues() {
478                    _resourcePermission.resetOriginalValues();
479            }
480    
481            private final ResourcePermission _resourcePermission;
482    }