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 ResourceBlockPermission}.
027     * </p>
028     *
029     * @author Brian Wing Shun Chan
030     * @see ResourceBlockPermission
031     * @generated
032     */
033    @ProviderType
034    public class ResourceBlockPermissionWrapper implements ResourceBlockPermission,
035            ModelWrapper<ResourceBlockPermission> {
036            public ResourceBlockPermissionWrapper(
037                    ResourceBlockPermission resourceBlockPermission) {
038                    _resourceBlockPermission = resourceBlockPermission;
039            }
040    
041            @Override
042            public Class<?> getModelClass() {
043                    return ResourceBlockPermission.class;
044            }
045    
046            @Override
047            public String getModelClassName() {
048                    return ResourceBlockPermission.class.getName();
049            }
050    
051            @Override
052            public Map<String, Object> getModelAttributes() {
053                    Map<String, Object> attributes = new HashMap<String, Object>();
054    
055                    attributes.put("mvccVersion", getMvccVersion());
056                    attributes.put("resourceBlockPermissionId",
057                            getResourceBlockPermissionId());
058                    attributes.put("companyId", getCompanyId());
059                    attributes.put("resourceBlockId", getResourceBlockId());
060                    attributes.put("roleId", getRoleId());
061                    attributes.put("actionIds", getActionIds());
062    
063                    return attributes;
064            }
065    
066            @Override
067            public void setModelAttributes(Map<String, Object> attributes) {
068                    Long mvccVersion = (Long)attributes.get("mvccVersion");
069    
070                    if (mvccVersion != null) {
071                            setMvccVersion(mvccVersion);
072                    }
073    
074                    Long resourceBlockPermissionId = (Long)attributes.get(
075                                    "resourceBlockPermissionId");
076    
077                    if (resourceBlockPermissionId != null) {
078                            setResourceBlockPermissionId(resourceBlockPermissionId);
079                    }
080    
081                    Long companyId = (Long)attributes.get("companyId");
082    
083                    if (companyId != null) {
084                            setCompanyId(companyId);
085                    }
086    
087                    Long resourceBlockId = (Long)attributes.get("resourceBlockId");
088    
089                    if (resourceBlockId != null) {
090                            setResourceBlockId(resourceBlockId);
091                    }
092    
093                    Long roleId = (Long)attributes.get("roleId");
094    
095                    if (roleId != null) {
096                            setRoleId(roleId);
097                    }
098    
099                    Long actionIds = (Long)attributes.get("actionIds");
100    
101                    if (actionIds != null) {
102                            setActionIds(actionIds);
103                    }
104            }
105    
106            @Override
107            public java.lang.Object clone() {
108                    return new ResourceBlockPermissionWrapper((ResourceBlockPermission)_resourceBlockPermission.clone());
109            }
110    
111            @Override
112            public int compareTo(
113                    com.liferay.portal.model.ResourceBlockPermission resourceBlockPermission) {
114                    return _resourceBlockPermission.compareTo(resourceBlockPermission);
115            }
116    
117            /**
118            * Returns the action IDs of this resource block permission.
119            *
120            * @return the action IDs of this resource block permission
121            */
122            @Override
123            public long getActionIds() {
124                    return _resourceBlockPermission.getActionIds();
125            }
126    
127            /**
128            * Returns the company ID of this resource block permission.
129            *
130            * @return the company ID of this resource block permission
131            */
132            @Override
133            public long getCompanyId() {
134                    return _resourceBlockPermission.getCompanyId();
135            }
136    
137            @Override
138            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
139                    return _resourceBlockPermission.getExpandoBridge();
140            }
141    
142            /**
143            * Returns the mvcc version of this resource block permission.
144            *
145            * @return the mvcc version of this resource block permission
146            */
147            @Override
148            public long getMvccVersion() {
149                    return _resourceBlockPermission.getMvccVersion();
150            }
151    
152            /**
153            * Returns the primary key of this resource block permission.
154            *
155            * @return the primary key of this resource block permission
156            */
157            @Override
158            public long getPrimaryKey() {
159                    return _resourceBlockPermission.getPrimaryKey();
160            }
161    
162            @Override
163            public java.io.Serializable getPrimaryKeyObj() {
164                    return _resourceBlockPermission.getPrimaryKeyObj();
165            }
166    
167            /**
168            * Returns the resource block ID of this resource block permission.
169            *
170            * @return the resource block ID of this resource block permission
171            */
172            @Override
173            public long getResourceBlockId() {
174                    return _resourceBlockPermission.getResourceBlockId();
175            }
176    
177            /**
178            * Returns the resource block permission ID of this resource block permission.
179            *
180            * @return the resource block permission ID of this resource block permission
181            */
182            @Override
183            public long getResourceBlockPermissionId() {
184                    return _resourceBlockPermission.getResourceBlockPermissionId();
185            }
186    
187            /**
188            * Returns the role ID of this resource block permission.
189            *
190            * @return the role ID of this resource block permission
191            */
192            @Override
193            public long getRoleId() {
194                    return _resourceBlockPermission.getRoleId();
195            }
196    
197            @Override
198            public int hashCode() {
199                    return _resourceBlockPermission.hashCode();
200            }
201    
202            @Override
203            public boolean isCachedModel() {
204                    return _resourceBlockPermission.isCachedModel();
205            }
206    
207            @Override
208            public boolean isEscapedModel() {
209                    return _resourceBlockPermission.isEscapedModel();
210            }
211    
212            @Override
213            public boolean isNew() {
214                    return _resourceBlockPermission.isNew();
215            }
216    
217            @Override
218            public void persist() {
219                    _resourceBlockPermission.persist();
220            }
221    
222            /**
223            * Sets the action IDs of this resource block permission.
224            *
225            * @param actionIds the action IDs of this resource block permission
226            */
227            @Override
228            public void setActionIds(long actionIds) {
229                    _resourceBlockPermission.setActionIds(actionIds);
230            }
231    
232            @Override
233            public void setCachedModel(boolean cachedModel) {
234                    _resourceBlockPermission.setCachedModel(cachedModel);
235            }
236    
237            /**
238            * Sets the company ID of this resource block permission.
239            *
240            * @param companyId the company ID of this resource block permission
241            */
242            @Override
243            public void setCompanyId(long companyId) {
244                    _resourceBlockPermission.setCompanyId(companyId);
245            }
246    
247            @Override
248            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
249                    _resourceBlockPermission.setExpandoBridgeAttributes(baseModel);
250            }
251    
252            @Override
253            public void setExpandoBridgeAttributes(
254                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
255                    _resourceBlockPermission.setExpandoBridgeAttributes(expandoBridge);
256            }
257    
258            @Override
259            public void setExpandoBridgeAttributes(
260                    com.liferay.portal.service.ServiceContext serviceContext) {
261                    _resourceBlockPermission.setExpandoBridgeAttributes(serviceContext);
262            }
263    
264            /**
265            * Sets the mvcc version of this resource block permission.
266            *
267            * @param mvccVersion the mvcc version of this resource block permission
268            */
269            @Override
270            public void setMvccVersion(long mvccVersion) {
271                    _resourceBlockPermission.setMvccVersion(mvccVersion);
272            }
273    
274            @Override
275            public void setNew(boolean n) {
276                    _resourceBlockPermission.setNew(n);
277            }
278    
279            /**
280            * Sets the primary key of this resource block permission.
281            *
282            * @param primaryKey the primary key of this resource block permission
283            */
284            @Override
285            public void setPrimaryKey(long primaryKey) {
286                    _resourceBlockPermission.setPrimaryKey(primaryKey);
287            }
288    
289            @Override
290            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
291                    _resourceBlockPermission.setPrimaryKeyObj(primaryKeyObj);
292            }
293    
294            /**
295            * Sets the resource block ID of this resource block permission.
296            *
297            * @param resourceBlockId the resource block ID of this resource block permission
298            */
299            @Override
300            public void setResourceBlockId(long resourceBlockId) {
301                    _resourceBlockPermission.setResourceBlockId(resourceBlockId);
302            }
303    
304            /**
305            * Sets the resource block permission ID of this resource block permission.
306            *
307            * @param resourceBlockPermissionId the resource block permission ID of this resource block permission
308            */
309            @Override
310            public void setResourceBlockPermissionId(long resourceBlockPermissionId) {
311                    _resourceBlockPermission.setResourceBlockPermissionId(resourceBlockPermissionId);
312            }
313    
314            /**
315            * Sets the role ID of this resource block permission.
316            *
317            * @param roleId the role ID of this resource block permission
318            */
319            @Override
320            public void setRoleId(long roleId) {
321                    _resourceBlockPermission.setRoleId(roleId);
322            }
323    
324            @Override
325            public CacheModel<com.liferay.portal.model.ResourceBlockPermission> toCacheModel() {
326                    return _resourceBlockPermission.toCacheModel();
327            }
328    
329            @Override
330            public com.liferay.portal.model.ResourceBlockPermission toEscapedModel() {
331                    return new ResourceBlockPermissionWrapper(_resourceBlockPermission.toEscapedModel());
332            }
333    
334            @Override
335            public java.lang.String toString() {
336                    return _resourceBlockPermission.toString();
337            }
338    
339            @Override
340            public com.liferay.portal.model.ResourceBlockPermission toUnescapedModel() {
341                    return new ResourceBlockPermissionWrapper(_resourceBlockPermission.toUnescapedModel());
342            }
343    
344            @Override
345            public java.lang.String toXmlString() {
346                    return _resourceBlockPermission.toXmlString();
347            }
348    
349            @Override
350            public boolean equals(Object obj) {
351                    if (this == obj) {
352                            return true;
353                    }
354    
355                    if (!(obj instanceof ResourceBlockPermissionWrapper)) {
356                            return false;
357                    }
358    
359                    ResourceBlockPermissionWrapper resourceBlockPermissionWrapper = (ResourceBlockPermissionWrapper)obj;
360    
361                    if (Validator.equals(_resourceBlockPermission,
362                                            resourceBlockPermissionWrapper._resourceBlockPermission)) {
363                            return true;
364                    }
365    
366                    return false;
367            }
368    
369            @Override
370            public ResourceBlockPermission getWrappedModel() {
371                    return _resourceBlockPermission;
372            }
373    
374            @Override
375            public boolean isEntityCacheEnabled() {
376                    return _resourceBlockPermission.isEntityCacheEnabled();
377            }
378    
379            @Override
380            public boolean isFinderCacheEnabled() {
381                    return _resourceBlockPermission.isFinderCacheEnabled();
382            }
383    
384            @Override
385            public void resetOriginalValues() {
386                    _resourceBlockPermission.resetOriginalValues();
387            }
388    
389            private final ResourceBlockPermission _resourceBlockPermission;
390    }