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 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 java.lang.Object clone() {
113                    return new ResourceBlockPermissionWrapper((ResourceBlockPermission)_resourceBlockPermission.clone());
114            }
115    
116            @Override
117            public int compareTo(
118                    com.liferay.portal.kernel.model.ResourceBlockPermission resourceBlockPermission) {
119                    return _resourceBlockPermission.compareTo(resourceBlockPermission);
120            }
121    
122            /**
123            * Returns the action IDs of this resource block permission.
124            *
125            * @return the action IDs of this resource block permission
126            */
127            @Override
128            public long getActionIds() {
129                    return _resourceBlockPermission.getActionIds();
130            }
131    
132            /**
133            * Returns the company ID of this resource block permission.
134            *
135            * @return the company ID of this resource block permission
136            */
137            @Override
138            public long getCompanyId() {
139                    return _resourceBlockPermission.getCompanyId();
140            }
141    
142            @Override
143            public ExpandoBridge getExpandoBridge() {
144                    return _resourceBlockPermission.getExpandoBridge();
145            }
146    
147            /**
148            * Returns the mvcc version of this resource block permission.
149            *
150            * @return the mvcc version of this resource block permission
151            */
152            @Override
153            public long getMvccVersion() {
154                    return _resourceBlockPermission.getMvccVersion();
155            }
156    
157            /**
158            * Returns the primary key of this resource block permission.
159            *
160            * @return the primary key of this resource block permission
161            */
162            @Override
163            public long getPrimaryKey() {
164                    return _resourceBlockPermission.getPrimaryKey();
165            }
166    
167            @Override
168            public Serializable getPrimaryKeyObj() {
169                    return _resourceBlockPermission.getPrimaryKeyObj();
170            }
171    
172            /**
173            * Returns the resource block ID of this resource block permission.
174            *
175            * @return the resource block ID of this resource block permission
176            */
177            @Override
178            public long getResourceBlockId() {
179                    return _resourceBlockPermission.getResourceBlockId();
180            }
181    
182            /**
183            * Returns the resource block permission ID of this resource block permission.
184            *
185            * @return the resource block permission ID of this resource block permission
186            */
187            @Override
188            public long getResourceBlockPermissionId() {
189                    return _resourceBlockPermission.getResourceBlockPermissionId();
190            }
191    
192            /**
193            * Returns the role ID of this resource block permission.
194            *
195            * @return the role ID of this resource block permission
196            */
197            @Override
198            public long getRoleId() {
199                    return _resourceBlockPermission.getRoleId();
200            }
201    
202            @Override
203            public int hashCode() {
204                    return _resourceBlockPermission.hashCode();
205            }
206    
207            @Override
208            public boolean isCachedModel() {
209                    return _resourceBlockPermission.isCachedModel();
210            }
211    
212            @Override
213            public boolean isEscapedModel() {
214                    return _resourceBlockPermission.isEscapedModel();
215            }
216    
217            @Override
218            public boolean isNew() {
219                    return _resourceBlockPermission.isNew();
220            }
221    
222            @Override
223            public void persist() {
224                    _resourceBlockPermission.persist();
225            }
226    
227            /**
228            * Sets the action IDs of this resource block permission.
229            *
230            * @param actionIds the action IDs of this resource block permission
231            */
232            @Override
233            public void setActionIds(long actionIds) {
234                    _resourceBlockPermission.setActionIds(actionIds);
235            }
236    
237            @Override
238            public void setCachedModel(boolean cachedModel) {
239                    _resourceBlockPermission.setCachedModel(cachedModel);
240            }
241    
242            /**
243            * Sets the company ID of this resource block permission.
244            *
245            * @param companyId the company ID of this resource block permission
246            */
247            @Override
248            public void setCompanyId(long companyId) {
249                    _resourceBlockPermission.setCompanyId(companyId);
250            }
251    
252            @Override
253            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
254                    _resourceBlockPermission.setExpandoBridgeAttributes(baseModel);
255            }
256    
257            @Override
258            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
259                    _resourceBlockPermission.setExpandoBridgeAttributes(expandoBridge);
260            }
261    
262            @Override
263            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
264                    _resourceBlockPermission.setExpandoBridgeAttributes(serviceContext);
265            }
266    
267            /**
268            * Sets the mvcc version of this resource block permission.
269            *
270            * @param mvccVersion the mvcc version of this resource block permission
271            */
272            @Override
273            public void setMvccVersion(long mvccVersion) {
274                    _resourceBlockPermission.setMvccVersion(mvccVersion);
275            }
276    
277            @Override
278            public void setNew(boolean n) {
279                    _resourceBlockPermission.setNew(n);
280            }
281    
282            /**
283            * Sets the primary key of this resource block permission.
284            *
285            * @param primaryKey the primary key of this resource block permission
286            */
287            @Override
288            public void setPrimaryKey(long primaryKey) {
289                    _resourceBlockPermission.setPrimaryKey(primaryKey);
290            }
291    
292            @Override
293            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
294                    _resourceBlockPermission.setPrimaryKeyObj(primaryKeyObj);
295            }
296    
297            /**
298            * Sets the resource block ID of this resource block permission.
299            *
300            * @param resourceBlockId the resource block ID of this resource block permission
301            */
302            @Override
303            public void setResourceBlockId(long resourceBlockId) {
304                    _resourceBlockPermission.setResourceBlockId(resourceBlockId);
305            }
306    
307            /**
308            * Sets the resource block permission ID of this resource block permission.
309            *
310            * @param resourceBlockPermissionId the resource block permission ID of this resource block permission
311            */
312            @Override
313            public void setResourceBlockPermissionId(long resourceBlockPermissionId) {
314                    _resourceBlockPermission.setResourceBlockPermissionId(resourceBlockPermissionId);
315            }
316    
317            /**
318            * Sets the role ID of this resource block permission.
319            *
320            * @param roleId the role ID of this resource block permission
321            */
322            @Override
323            public void setRoleId(long roleId) {
324                    _resourceBlockPermission.setRoleId(roleId);
325            }
326    
327            @Override
328            public CacheModel<com.liferay.portal.kernel.model.ResourceBlockPermission> toCacheModel() {
329                    return _resourceBlockPermission.toCacheModel();
330            }
331    
332            @Override
333            public com.liferay.portal.kernel.model.ResourceBlockPermission toEscapedModel() {
334                    return new ResourceBlockPermissionWrapper(_resourceBlockPermission.toEscapedModel());
335            }
336    
337            @Override
338            public java.lang.String toString() {
339                    return _resourceBlockPermission.toString();
340            }
341    
342            @Override
343            public com.liferay.portal.kernel.model.ResourceBlockPermission toUnescapedModel() {
344                    return new ResourceBlockPermissionWrapper(_resourceBlockPermission.toUnescapedModel());
345            }
346    
347            @Override
348            public java.lang.String toXmlString() {
349                    return _resourceBlockPermission.toXmlString();
350            }
351    
352            @Override
353            public boolean equals(Object obj) {
354                    if (this == obj) {
355                            return true;
356                    }
357    
358                    if (!(obj instanceof ResourceBlockPermissionWrapper)) {
359                            return false;
360                    }
361    
362                    ResourceBlockPermissionWrapper resourceBlockPermissionWrapper = (ResourceBlockPermissionWrapper)obj;
363    
364                    if (Validator.equals(_resourceBlockPermission,
365                                            resourceBlockPermissionWrapper._resourceBlockPermission)) {
366                            return true;
367                    }
368    
369                    return false;
370            }
371    
372            @Override
373            public ResourceBlockPermission getWrappedModel() {
374                    return _resourceBlockPermission;
375            }
376    
377            @Override
378            public boolean isEntityCacheEnabled() {
379                    return _resourceBlockPermission.isEntityCacheEnabled();
380            }
381    
382            @Override
383            public boolean isFinderCacheEnabled() {
384                    return _resourceBlockPermission.isFinderCacheEnabled();
385            }
386    
387            @Override
388            public void resetOriginalValues() {
389                    _resourceBlockPermission.resetOriginalValues();
390            }
391    
392            private final ResourceBlockPermission _resourceBlockPermission;
393    }