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