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