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