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(BaseModel<?> baseModel) {
222                    _resourceBlockPermission.setExpandoBridgeAttributes(baseModel);
223            }
224    
225            @Override
226            public void setExpandoBridgeAttributes(
227                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
228                    _resourceBlockPermission.setExpandoBridgeAttributes(expandoBridge);
229            }
230    
231            @Override
232            public void setExpandoBridgeAttributes(
233                    com.liferay.portal.service.ServiceContext serviceContext) {
234                    _resourceBlockPermission.setExpandoBridgeAttributes(serviceContext);
235            }
236    
237            /**
238            * Sets the mvcc version of this resource block permission.
239            *
240            * @param mvccVersion the mvcc version of this resource block permission
241            */
242            @Override
243            public void setMvccVersion(long mvccVersion) {
244                    _resourceBlockPermission.setMvccVersion(mvccVersion);
245            }
246    
247            @Override
248            public void setNew(boolean n) {
249                    _resourceBlockPermission.setNew(n);
250            }
251    
252            /**
253            * Sets the primary key of this resource block permission.
254            *
255            * @param primaryKey the primary key of this resource block permission
256            */
257            @Override
258            public void setPrimaryKey(long primaryKey) {
259                    _resourceBlockPermission.setPrimaryKey(primaryKey);
260            }
261    
262            @Override
263            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
264                    _resourceBlockPermission.setPrimaryKeyObj(primaryKeyObj);
265            }
266    
267            /**
268            * Sets the resource block ID of this resource block permission.
269            *
270            * @param resourceBlockId the resource block ID of this resource block permission
271            */
272            @Override
273            public void setResourceBlockId(long resourceBlockId) {
274                    _resourceBlockPermission.setResourceBlockId(resourceBlockId);
275            }
276    
277            /**
278            * Sets the resource block permission ID of this resource block permission.
279            *
280            * @param resourceBlockPermissionId the resource block permission ID of this resource block permission
281            */
282            @Override
283            public void setResourceBlockPermissionId(long resourceBlockPermissionId) {
284                    _resourceBlockPermission.setResourceBlockPermissionId(resourceBlockPermissionId);
285            }
286    
287            /**
288            * Sets the role ID of this resource block permission.
289            *
290            * @param roleId the role ID of this resource block permission
291            */
292            @Override
293            public void setRoleId(long roleId) {
294                    _resourceBlockPermission.setRoleId(roleId);
295            }
296    
297            @Override
298            public CacheModel<com.liferay.portal.model.ResourceBlockPermission> toCacheModel() {
299                    return _resourceBlockPermission.toCacheModel();
300            }
301    
302            @Override
303            public com.liferay.portal.model.ResourceBlockPermission toEscapedModel() {
304                    return new ResourceBlockPermissionWrapper(_resourceBlockPermission.toEscapedModel());
305            }
306    
307            @Override
308            public java.lang.String toString() {
309                    return _resourceBlockPermission.toString();
310            }
311    
312            @Override
313            public com.liferay.portal.model.ResourceBlockPermission toUnescapedModel() {
314                    return new ResourceBlockPermissionWrapper(_resourceBlockPermission.toUnescapedModel());
315            }
316    
317            @Override
318            public java.lang.String toXmlString() {
319                    return _resourceBlockPermission.toXmlString();
320            }
321    
322            @Override
323            public boolean equals(Object obj) {
324                    if (this == obj) {
325                            return true;
326                    }
327    
328                    if (!(obj instanceof ResourceBlockPermissionWrapper)) {
329                            return false;
330                    }
331    
332                    ResourceBlockPermissionWrapper resourceBlockPermissionWrapper = (ResourceBlockPermissionWrapper)obj;
333    
334                    if (Validator.equals(_resourceBlockPermission,
335                                            resourceBlockPermissionWrapper._resourceBlockPermission)) {
336                            return true;
337                    }
338    
339                    return false;
340            }
341    
342            /**
343             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
344             */
345            @Deprecated
346            public ResourceBlockPermission getWrappedResourceBlockPermission() {
347                    return _resourceBlockPermission;
348            }
349    
350            @Override
351            public ResourceBlockPermission getWrappedModel() {
352                    return _resourceBlockPermission;
353            }
354    
355            @Override
356            public boolean isEntityCacheEnabled() {
357                    return _resourceBlockPermission.isEntityCacheEnabled();
358            }
359    
360            @Override
361            public boolean isFinderCacheEnabled() {
362                    return _resourceBlockPermission.isFinderCacheEnabled();
363            }
364    
365            @Override
366            public void resetOriginalValues() {
367                    _resourceBlockPermission.resetOriginalValues();
368            }
369    
370            private final ResourceBlockPermission _resourceBlockPermission;
371    }