001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.model;
016    
017    import java.util.HashMap;
018    import java.util.Map;
019    
020    /**
021     * <p>
022     * This class is a wrapper for {@link Permission}.
023     * </p>
024     *
025     * @author    Brian Wing Shun Chan
026     * @see       Permission
027     * @generated
028     */
029    public class PermissionWrapper implements Permission, ModelWrapper<Permission> {
030            public PermissionWrapper(Permission permission) {
031                    _permission = permission;
032            }
033    
034            public Class<?> getModelClass() {
035                    return Permission.class;
036            }
037    
038            public String getModelClassName() {
039                    return Permission.class.getName();
040            }
041    
042            public Map<String, Object> getModelAttributes() {
043                    Map<String, Object> attributes = new HashMap<String, Object>();
044    
045                    attributes.put("permissionId", getPermissionId());
046                    attributes.put("companyId", getCompanyId());
047                    attributes.put("actionId", getActionId());
048                    attributes.put("resourceId", getResourceId());
049    
050                    return attributes;
051            }
052    
053            public void setModelAttributes(Map<String, Object> attributes) {
054                    Long permissionId = (Long)attributes.get("permissionId");
055    
056                    if (permissionId != null) {
057                            setPermissionId(permissionId);
058                    }
059    
060                    Long companyId = (Long)attributes.get("companyId");
061    
062                    if (companyId != null) {
063                            setCompanyId(companyId);
064                    }
065    
066                    String actionId = (String)attributes.get("actionId");
067    
068                    if (actionId != null) {
069                            setActionId(actionId);
070                    }
071    
072                    Long resourceId = (Long)attributes.get("resourceId");
073    
074                    if (resourceId != null) {
075                            setResourceId(resourceId);
076                    }
077            }
078    
079            /**
080            * Returns the primary key of this permission.
081            *
082            * @return the primary key of this permission
083            */
084            public long getPrimaryKey() {
085                    return _permission.getPrimaryKey();
086            }
087    
088            /**
089            * Sets the primary key of this permission.
090            *
091            * @param primaryKey the primary key of this permission
092            */
093            public void setPrimaryKey(long primaryKey) {
094                    _permission.setPrimaryKey(primaryKey);
095            }
096    
097            /**
098            * Returns the permission ID of this permission.
099            *
100            * @return the permission ID of this permission
101            */
102            public long getPermissionId() {
103                    return _permission.getPermissionId();
104            }
105    
106            /**
107            * Sets the permission ID of this permission.
108            *
109            * @param permissionId the permission ID of this permission
110            */
111            public void setPermissionId(long permissionId) {
112                    _permission.setPermissionId(permissionId);
113            }
114    
115            /**
116            * Returns the company ID of this permission.
117            *
118            * @return the company ID of this permission
119            */
120            public long getCompanyId() {
121                    return _permission.getCompanyId();
122            }
123    
124            /**
125            * Sets the company ID of this permission.
126            *
127            * @param companyId the company ID of this permission
128            */
129            public void setCompanyId(long companyId) {
130                    _permission.setCompanyId(companyId);
131            }
132    
133            /**
134            * Returns the action ID of this permission.
135            *
136            * @return the action ID of this permission
137            */
138            public java.lang.String getActionId() {
139                    return _permission.getActionId();
140            }
141    
142            /**
143            * Sets the action ID of this permission.
144            *
145            * @param actionId the action ID of this permission
146            */
147            public void setActionId(java.lang.String actionId) {
148                    _permission.setActionId(actionId);
149            }
150    
151            /**
152            * Returns the resource ID of this permission.
153            *
154            * @return the resource ID of this permission
155            */
156            public long getResourceId() {
157                    return _permission.getResourceId();
158            }
159    
160            /**
161            * Sets the resource ID of this permission.
162            *
163            * @param resourceId the resource ID of this permission
164            */
165            public void setResourceId(long resourceId) {
166                    _permission.setResourceId(resourceId);
167            }
168    
169            public boolean isNew() {
170                    return _permission.isNew();
171            }
172    
173            public void setNew(boolean n) {
174                    _permission.setNew(n);
175            }
176    
177            public boolean isCachedModel() {
178                    return _permission.isCachedModel();
179            }
180    
181            public void setCachedModel(boolean cachedModel) {
182                    _permission.setCachedModel(cachedModel);
183            }
184    
185            public boolean isEscapedModel() {
186                    return _permission.isEscapedModel();
187            }
188    
189            public java.io.Serializable getPrimaryKeyObj() {
190                    return _permission.getPrimaryKeyObj();
191            }
192    
193            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
194                    _permission.setPrimaryKeyObj(primaryKeyObj);
195            }
196    
197            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
198                    return _permission.getExpandoBridge();
199            }
200    
201            public void setExpandoBridgeAttributes(
202                    com.liferay.portal.service.ServiceContext serviceContext) {
203                    _permission.setExpandoBridgeAttributes(serviceContext);
204            }
205    
206            @Override
207            public java.lang.Object clone() {
208                    return new PermissionWrapper((Permission)_permission.clone());
209            }
210    
211            public int compareTo(com.liferay.portal.model.Permission permission) {
212                    return _permission.compareTo(permission);
213            }
214    
215            @Override
216            public int hashCode() {
217                    return _permission.hashCode();
218            }
219    
220            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.Permission> toCacheModel() {
221                    return _permission.toCacheModel();
222            }
223    
224            public com.liferay.portal.model.Permission toEscapedModel() {
225                    return new PermissionWrapper(_permission.toEscapedModel());
226            }
227    
228            @Override
229            public java.lang.String toString() {
230                    return _permission.toString();
231            }
232    
233            public java.lang.String toXmlString() {
234                    return _permission.toXmlString();
235            }
236    
237            public void persist()
238                    throws com.liferay.portal.kernel.exception.SystemException {
239                    _permission.persist();
240            }
241    
242            public java.lang.String getName() {
243                    return _permission.getName();
244            }
245    
246            public java.lang.String getPrimKey() {
247                    return _permission.getPrimKey();
248            }
249    
250            public int getScope() {
251                    return _permission.getScope();
252            }
253    
254            public void setName(java.lang.String name) {
255                    _permission.setName(name);
256            }
257    
258            public void setPrimKey(java.lang.String primKey) {
259                    _permission.setPrimKey(primKey);
260            }
261    
262            public void setScope(int scope) {
263                    _permission.setScope(scope);
264            }
265    
266            /**
267             * @deprecated Renamed to {@link #getWrappedModel}
268             */
269            public Permission getWrappedPermission() {
270                    return _permission;
271            }
272    
273            public Permission getWrappedModel() {
274                    return _permission;
275            }
276    
277            public void resetOriginalValues() {
278                    _permission.resetOriginalValues();
279            }
280    
281            private Permission _permission;
282    }