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