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