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