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