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