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 ResourceTypePermission}.
025     * </p>
026     *
027     * @author Brian Wing Shun Chan
028     * @see ResourceTypePermission
029     * @generated
030     */
031    public class ResourceTypePermissionWrapper implements ResourceTypePermission,
032            ModelWrapper<ResourceTypePermission> {
033            public ResourceTypePermissionWrapper(
034                    ResourceTypePermission resourceTypePermission) {
035                    _resourceTypePermission = resourceTypePermission;
036            }
037    
038            @Override
039            public Class<?> getModelClass() {
040                    return ResourceTypePermission.class;
041            }
042    
043            @Override
044            public String getModelClassName() {
045                    return ResourceTypePermission.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("resourceTypePermissionId", getResourceTypePermissionId());
053                    attributes.put("companyId", getCompanyId());
054                    attributes.put("groupId", getGroupId());
055                    attributes.put("name", getName());
056                    attributes.put("roleId", getRoleId());
057                    attributes.put("actionIds", getActionIds());
058    
059                    return attributes;
060            }
061    
062            @Override
063            public void setModelAttributes(Map<String, Object> attributes) {
064                    Long resourceTypePermissionId = (Long)attributes.get(
065                                    "resourceTypePermissionId");
066    
067                    if (resourceTypePermissionId != null) {
068                            setResourceTypePermissionId(resourceTypePermissionId);
069                    }
070    
071                    Long companyId = (Long)attributes.get("companyId");
072    
073                    if (companyId != null) {
074                            setCompanyId(companyId);
075                    }
076    
077                    Long groupId = (Long)attributes.get("groupId");
078    
079                    if (groupId != null) {
080                            setGroupId(groupId);
081                    }
082    
083                    String name = (String)attributes.get("name");
084    
085                    if (name != null) {
086                            setName(name);
087                    }
088    
089                    Long roleId = (Long)attributes.get("roleId");
090    
091                    if (roleId != null) {
092                            setRoleId(roleId);
093                    }
094    
095                    Long actionIds = (Long)attributes.get("actionIds");
096    
097                    if (actionIds != null) {
098                            setActionIds(actionIds);
099                    }
100            }
101    
102            /**
103            * Returns the primary key of this resource type permission.
104            *
105            * @return the primary key of this resource type permission
106            */
107            @Override
108            public long getPrimaryKey() {
109                    return _resourceTypePermission.getPrimaryKey();
110            }
111    
112            /**
113            * Sets the primary key of this resource type permission.
114            *
115            * @param primaryKey the primary key of this resource type permission
116            */
117            @Override
118            public void setPrimaryKey(long primaryKey) {
119                    _resourceTypePermission.setPrimaryKey(primaryKey);
120            }
121    
122            /**
123            * Returns the resource type permission ID of this resource type permission.
124            *
125            * @return the resource type permission ID of this resource type permission
126            */
127            @Override
128            public long getResourceTypePermissionId() {
129                    return _resourceTypePermission.getResourceTypePermissionId();
130            }
131    
132            /**
133            * Sets the resource type permission ID of this resource type permission.
134            *
135            * @param resourceTypePermissionId the resource type permission ID of this resource type permission
136            */
137            @Override
138            public void setResourceTypePermissionId(long resourceTypePermissionId) {
139                    _resourceTypePermission.setResourceTypePermissionId(resourceTypePermissionId);
140            }
141    
142            /**
143            * Returns the company ID of this resource type permission.
144            *
145            * @return the company ID of this resource type permission
146            */
147            @Override
148            public long getCompanyId() {
149                    return _resourceTypePermission.getCompanyId();
150            }
151    
152            /**
153            * Sets the company ID of this resource type permission.
154            *
155            * @param companyId the company ID of this resource type permission
156            */
157            @Override
158            public void setCompanyId(long companyId) {
159                    _resourceTypePermission.setCompanyId(companyId);
160            }
161    
162            /**
163            * Returns the group ID of this resource type permission.
164            *
165            * @return the group ID of this resource type permission
166            */
167            @Override
168            public long getGroupId() {
169                    return _resourceTypePermission.getGroupId();
170            }
171    
172            /**
173            * Sets the group ID of this resource type permission.
174            *
175            * @param groupId the group ID of this resource type permission
176            */
177            @Override
178            public void setGroupId(long groupId) {
179                    _resourceTypePermission.setGroupId(groupId);
180            }
181    
182            /**
183            * Returns the name of this resource type permission.
184            *
185            * @return the name of this resource type permission
186            */
187            @Override
188            public java.lang.String getName() {
189                    return _resourceTypePermission.getName();
190            }
191    
192            /**
193            * Sets the name of this resource type permission.
194            *
195            * @param name the name of this resource type permission
196            */
197            @Override
198            public void setName(java.lang.String name) {
199                    _resourceTypePermission.setName(name);
200            }
201    
202            /**
203            * Returns the role ID of this resource type permission.
204            *
205            * @return the role ID of this resource type permission
206            */
207            @Override
208            public long getRoleId() {
209                    return _resourceTypePermission.getRoleId();
210            }
211    
212            /**
213            * Sets the role ID of this resource type permission.
214            *
215            * @param roleId the role ID of this resource type permission
216            */
217            @Override
218            public void setRoleId(long roleId) {
219                    _resourceTypePermission.setRoleId(roleId);
220            }
221    
222            /**
223            * Returns the action IDs of this resource type permission.
224            *
225            * @return the action IDs of this resource type permission
226            */
227            @Override
228            public long getActionIds() {
229                    return _resourceTypePermission.getActionIds();
230            }
231    
232            /**
233            * Sets the action IDs of this resource type permission.
234            *
235            * @param actionIds the action IDs of this resource type permission
236            */
237            @Override
238            public void setActionIds(long actionIds) {
239                    _resourceTypePermission.setActionIds(actionIds);
240            }
241    
242            @Override
243            public boolean isNew() {
244                    return _resourceTypePermission.isNew();
245            }
246    
247            @Override
248            public void setNew(boolean n) {
249                    _resourceTypePermission.setNew(n);
250            }
251    
252            @Override
253            public boolean isCachedModel() {
254                    return _resourceTypePermission.isCachedModel();
255            }
256    
257            @Override
258            public void setCachedModel(boolean cachedModel) {
259                    _resourceTypePermission.setCachedModel(cachedModel);
260            }
261    
262            @Override
263            public boolean isEscapedModel() {
264                    return _resourceTypePermission.isEscapedModel();
265            }
266    
267            @Override
268            public java.io.Serializable getPrimaryKeyObj() {
269                    return _resourceTypePermission.getPrimaryKeyObj();
270            }
271    
272            @Override
273            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
274                    _resourceTypePermission.setPrimaryKeyObj(primaryKeyObj);
275            }
276    
277            @Override
278            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
279                    return _resourceTypePermission.getExpandoBridge();
280            }
281    
282            @Override
283            public void setExpandoBridgeAttributes(
284                    com.liferay.portal.model.BaseModel<?> baseModel) {
285                    _resourceTypePermission.setExpandoBridgeAttributes(baseModel);
286            }
287    
288            @Override
289            public void setExpandoBridgeAttributes(
290                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
291                    _resourceTypePermission.setExpandoBridgeAttributes(expandoBridge);
292            }
293    
294            @Override
295            public void setExpandoBridgeAttributes(
296                    com.liferay.portal.service.ServiceContext serviceContext) {
297                    _resourceTypePermission.setExpandoBridgeAttributes(serviceContext);
298            }
299    
300            @Override
301            public java.lang.Object clone() {
302                    return new ResourceTypePermissionWrapper((ResourceTypePermission)_resourceTypePermission.clone());
303            }
304    
305            @Override
306            public int compareTo(
307                    com.liferay.portal.model.ResourceTypePermission resourceTypePermission) {
308                    return _resourceTypePermission.compareTo(resourceTypePermission);
309            }
310    
311            @Override
312            public int hashCode() {
313                    return _resourceTypePermission.hashCode();
314            }
315    
316            @Override
317            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.ResourceTypePermission> toCacheModel() {
318                    return _resourceTypePermission.toCacheModel();
319            }
320    
321            @Override
322            public com.liferay.portal.model.ResourceTypePermission toEscapedModel() {
323                    return new ResourceTypePermissionWrapper(_resourceTypePermission.toEscapedModel());
324            }
325    
326            @Override
327            public com.liferay.portal.model.ResourceTypePermission toUnescapedModel() {
328                    return new ResourceTypePermissionWrapper(_resourceTypePermission.toUnescapedModel());
329            }
330    
331            @Override
332            public java.lang.String toString() {
333                    return _resourceTypePermission.toString();
334            }
335    
336            @Override
337            public java.lang.String toXmlString() {
338                    return _resourceTypePermission.toXmlString();
339            }
340    
341            @Override
342            public void persist()
343                    throws com.liferay.portal.kernel.exception.SystemException {
344                    _resourceTypePermission.persist();
345            }
346    
347            @Override
348            public boolean isCompanyScope() {
349                    return _resourceTypePermission.isCompanyScope();
350            }
351    
352            @Override
353            public boolean isGroupScope() {
354                    return _resourceTypePermission.isGroupScope();
355            }
356    
357            @Override
358            public boolean equals(Object obj) {
359                    if (this == obj) {
360                            return true;
361                    }
362    
363                    if (!(obj instanceof ResourceTypePermissionWrapper)) {
364                            return false;
365                    }
366    
367                    ResourceTypePermissionWrapper resourceTypePermissionWrapper = (ResourceTypePermissionWrapper)obj;
368    
369                    if (Validator.equals(_resourceTypePermission,
370                                            resourceTypePermissionWrapper._resourceTypePermission)) {
371                            return true;
372                    }
373    
374                    return false;
375            }
376    
377            /**
378             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
379             */
380            public ResourceTypePermission getWrappedResourceTypePermission() {
381                    return _resourceTypePermission;
382            }
383    
384            @Override
385            public ResourceTypePermission getWrappedModel() {
386                    return _resourceTypePermission;
387            }
388    
389            @Override
390            public void resetOriginalValues() {
391                    _resourceTypePermission.resetOriginalValues();
392            }
393    
394            private ResourceTypePermission _resourceTypePermission;
395    }