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