001    /**
002     * Copyright (c) 2000-2012 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 java.util.HashMap;
018    import java.util.Map;
019    
020    /**
021     * <p>
022     * This class is a wrapper for {@link UserGroupRole}.
023     * </p>
024     *
025     * @author    Brian Wing Shun Chan
026     * @see       UserGroupRole
027     * @generated
028     */
029    public class UserGroupRoleWrapper implements UserGroupRole,
030            ModelWrapper<UserGroupRole> {
031            public UserGroupRoleWrapper(UserGroupRole userGroupRole) {
032                    _userGroupRole = userGroupRole;
033            }
034    
035            public Class<?> getModelClass() {
036                    return UserGroupRole.class;
037            }
038    
039            public String getModelClassName() {
040                    return UserGroupRole.class.getName();
041            }
042    
043            public Map<String, Object> getModelAttributes() {
044                    Map<String, Object> attributes = new HashMap<String, Object>();
045    
046                    attributes.put("userId", getUserId());
047                    attributes.put("groupId", getGroupId());
048                    attributes.put("roleId", getRoleId());
049    
050                    return attributes;
051            }
052    
053            public void setModelAttributes(Map<String, Object> attributes) {
054                    Long userId = (Long)attributes.get("userId");
055    
056                    if (userId != null) {
057                            setUserId(userId);
058                    }
059    
060                    Long groupId = (Long)attributes.get("groupId");
061    
062                    if (groupId != null) {
063                            setGroupId(groupId);
064                    }
065    
066                    Long roleId = (Long)attributes.get("roleId");
067    
068                    if (roleId != null) {
069                            setRoleId(roleId);
070                    }
071            }
072    
073            /**
074            * Returns the primary key of this user group role.
075            *
076            * @return the primary key of this user group role
077            */
078            public com.liferay.portal.service.persistence.UserGroupRolePK getPrimaryKey() {
079                    return _userGroupRole.getPrimaryKey();
080            }
081    
082            /**
083            * Sets the primary key of this user group role.
084            *
085            * @param primaryKey the primary key of this user group role
086            */
087            public void setPrimaryKey(
088                    com.liferay.portal.service.persistence.UserGroupRolePK primaryKey) {
089                    _userGroupRole.setPrimaryKey(primaryKey);
090            }
091    
092            /**
093            * Returns the user ID of this user group role.
094            *
095            * @return the user ID of this user group role
096            */
097            public long getUserId() {
098                    return _userGroupRole.getUserId();
099            }
100    
101            /**
102            * Sets the user ID of this user group role.
103            *
104            * @param userId the user ID of this user group role
105            */
106            public void setUserId(long userId) {
107                    _userGroupRole.setUserId(userId);
108            }
109    
110            /**
111            * Returns the user uuid of this user group role.
112            *
113            * @return the user uuid of this user group role
114            * @throws SystemException if a system exception occurred
115            */
116            public java.lang.String getUserUuid()
117                    throws com.liferay.portal.kernel.exception.SystemException {
118                    return _userGroupRole.getUserUuid();
119            }
120    
121            /**
122            * Sets the user uuid of this user group role.
123            *
124            * @param userUuid the user uuid of this user group role
125            */
126            public void setUserUuid(java.lang.String userUuid) {
127                    _userGroupRole.setUserUuid(userUuid);
128            }
129    
130            /**
131            * Returns the group ID of this user group role.
132            *
133            * @return the group ID of this user group role
134            */
135            public long getGroupId() {
136                    return _userGroupRole.getGroupId();
137            }
138    
139            /**
140            * Sets the group ID of this user group role.
141            *
142            * @param groupId the group ID of this user group role
143            */
144            public void setGroupId(long groupId) {
145                    _userGroupRole.setGroupId(groupId);
146            }
147    
148            /**
149            * Returns the role ID of this user group role.
150            *
151            * @return the role ID of this user group role
152            */
153            public long getRoleId() {
154                    return _userGroupRole.getRoleId();
155            }
156    
157            /**
158            * Sets the role ID of this user group role.
159            *
160            * @param roleId the role ID of this user group role
161            */
162            public void setRoleId(long roleId) {
163                    _userGroupRole.setRoleId(roleId);
164            }
165    
166            public boolean isNew() {
167                    return _userGroupRole.isNew();
168            }
169    
170            public void setNew(boolean n) {
171                    _userGroupRole.setNew(n);
172            }
173    
174            public boolean isCachedModel() {
175                    return _userGroupRole.isCachedModel();
176            }
177    
178            public void setCachedModel(boolean cachedModel) {
179                    _userGroupRole.setCachedModel(cachedModel);
180            }
181    
182            public boolean isEscapedModel() {
183                    return _userGroupRole.isEscapedModel();
184            }
185    
186            public java.io.Serializable getPrimaryKeyObj() {
187                    return _userGroupRole.getPrimaryKeyObj();
188            }
189    
190            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
191                    _userGroupRole.setPrimaryKeyObj(primaryKeyObj);
192            }
193    
194            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
195                    return _userGroupRole.getExpandoBridge();
196            }
197    
198            public void setExpandoBridgeAttributes(
199                    com.liferay.portal.service.ServiceContext serviceContext) {
200                    _userGroupRole.setExpandoBridgeAttributes(serviceContext);
201            }
202    
203            @Override
204            public java.lang.Object clone() {
205                    return new UserGroupRoleWrapper((UserGroupRole)_userGroupRole.clone());
206            }
207    
208            public int compareTo(com.liferay.portal.model.UserGroupRole userGroupRole) {
209                    return _userGroupRole.compareTo(userGroupRole);
210            }
211    
212            @Override
213            public int hashCode() {
214                    return _userGroupRole.hashCode();
215            }
216    
217            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.UserGroupRole> toCacheModel() {
218                    return _userGroupRole.toCacheModel();
219            }
220    
221            public com.liferay.portal.model.UserGroupRole toEscapedModel() {
222                    return new UserGroupRoleWrapper(_userGroupRole.toEscapedModel());
223            }
224    
225            @Override
226            public java.lang.String toString() {
227                    return _userGroupRole.toString();
228            }
229    
230            public java.lang.String toXmlString() {
231                    return _userGroupRole.toXmlString();
232            }
233    
234            public void persist()
235                    throws com.liferay.portal.kernel.exception.SystemException {
236                    _userGroupRole.persist();
237            }
238    
239            public com.liferay.portal.model.Group getGroup()
240                    throws com.liferay.portal.kernel.exception.PortalException,
241                            com.liferay.portal.kernel.exception.SystemException {
242                    return _userGroupRole.getGroup();
243            }
244    
245            public com.liferay.portal.model.Role getRole()
246                    throws com.liferay.portal.kernel.exception.PortalException,
247                            com.liferay.portal.kernel.exception.SystemException {
248                    return _userGroupRole.getRole();
249            }
250    
251            public com.liferay.portal.model.User getUser()
252                    throws com.liferay.portal.kernel.exception.PortalException,
253                            com.liferay.portal.kernel.exception.SystemException {
254                    return _userGroupRole.getUser();
255            }
256    
257            /**
258             * @deprecated Renamed to {@link #getWrappedModel}
259             */
260            public UserGroupRole getWrappedUserGroupRole() {
261                    return _userGroupRole;
262            }
263    
264            public UserGroupRole getWrappedModel() {
265                    return _userGroupRole;
266            }
267    
268            public void resetOriginalValues() {
269                    _userGroupRole.resetOriginalValues();
270            }
271    
272            private UserGroupRole _userGroupRole;
273    }