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