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