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