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    import com.liferay.portal.service.ServiceContext;
021    
022    import com.liferay.portlet.expando.model.ExpandoBridge;
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(com.liferay.portal.model.UserGroupRole userGroupRole) {
108                    return _userGroupRole.compareTo(userGroupRole);
109            }
110    
111            /**
112            * Returns the company ID of this user group role.
113            *
114            * @return the company ID of this user group role
115            */
116            @Override
117            public long getCompanyId() {
118                    return _userGroupRole.getCompanyId();
119            }
120    
121            @Override
122            public ExpandoBridge getExpandoBridge() {
123                    return _userGroupRole.getExpandoBridge();
124            }
125    
126            @Override
127            public com.liferay.portal.model.Group getGroup()
128                    throws com.liferay.portal.kernel.exception.PortalException {
129                    return _userGroupRole.getGroup();
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            @Override
138            public long getGroupId() {
139                    return _userGroupRole.getGroupId();
140            }
141    
142            /**
143            * Returns the mvcc version of this user group role.
144            *
145            * @return the mvcc version of this user group role
146            */
147            @Override
148            public long getMvccVersion() {
149                    return _userGroupRole.getMvccVersion();
150            }
151    
152            /**
153            * Returns the primary key of this user group role.
154            *
155            * @return the primary key of this user group role
156            */
157            @Override
158            public com.liferay.portal.service.persistence.UserGroupRolePK getPrimaryKey() {
159                    return _userGroupRole.getPrimaryKey();
160            }
161    
162            @Override
163            public Serializable getPrimaryKeyObj() {
164                    return _userGroupRole.getPrimaryKeyObj();
165            }
166    
167            @Override
168            public com.liferay.portal.model.Role getRole()
169                    throws com.liferay.portal.kernel.exception.PortalException {
170                    return _userGroupRole.getRole();
171            }
172    
173            /**
174            * Returns the role ID of this user group role.
175            *
176            * @return the role ID of this user group role
177            */
178            @Override
179            public long getRoleId() {
180                    return _userGroupRole.getRoleId();
181            }
182    
183            @Override
184            public com.liferay.portal.model.User getUser()
185                    throws com.liferay.portal.kernel.exception.PortalException {
186                    return _userGroupRole.getUser();
187            }
188    
189            /**
190            * Returns the user ID of this user group role.
191            *
192            * @return the user ID of this user group role
193            */
194            @Override
195            public long getUserId() {
196                    return _userGroupRole.getUserId();
197            }
198    
199            /**
200            * Returns the user uuid of this user group role.
201            *
202            * @return the user uuid of this user group role
203            */
204            @Override
205            public java.lang.String getUserUuid() {
206                    return _userGroupRole.getUserUuid();
207            }
208    
209            @Override
210            public int hashCode() {
211                    return _userGroupRole.hashCode();
212            }
213    
214            @Override
215            public boolean isCachedModel() {
216                    return _userGroupRole.isCachedModel();
217            }
218    
219            @Override
220            public boolean isEscapedModel() {
221                    return _userGroupRole.isEscapedModel();
222            }
223    
224            @Override
225            public boolean isNew() {
226                    return _userGroupRole.isNew();
227            }
228    
229            @Override
230            public void persist() {
231                    _userGroupRole.persist();
232            }
233    
234            @Override
235            public void setCachedModel(boolean cachedModel) {
236                    _userGroupRole.setCachedModel(cachedModel);
237            }
238    
239            /**
240            * Sets the company ID of this user group role.
241            *
242            * @param companyId the company ID of this user group role
243            */
244            @Override
245            public void setCompanyId(long companyId) {
246                    _userGroupRole.setCompanyId(companyId);
247            }
248    
249            @Override
250            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
251                    _userGroupRole.setExpandoBridgeAttributes(baseModel);
252            }
253    
254            @Override
255            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
256                    _userGroupRole.setExpandoBridgeAttributes(expandoBridge);
257            }
258    
259            @Override
260            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
261                    _userGroupRole.setExpandoBridgeAttributes(serviceContext);
262            }
263    
264            /**
265            * Sets the group ID of this user group role.
266            *
267            * @param groupId the group ID of this user group role
268            */
269            @Override
270            public void setGroupId(long groupId) {
271                    _userGroupRole.setGroupId(groupId);
272            }
273    
274            /**
275            * Sets the mvcc version of this user group role.
276            *
277            * @param mvccVersion the mvcc version of this user group role
278            */
279            @Override
280            public void setMvccVersion(long mvccVersion) {
281                    _userGroupRole.setMvccVersion(mvccVersion);
282            }
283    
284            @Override
285            public void setNew(boolean n) {
286                    _userGroupRole.setNew(n);
287            }
288    
289            /**
290            * Sets the primary key of this user group role.
291            *
292            * @param primaryKey the primary key of this user group role
293            */
294            @Override
295            public void setPrimaryKey(
296                    com.liferay.portal.service.persistence.UserGroupRolePK primaryKey) {
297                    _userGroupRole.setPrimaryKey(primaryKey);
298            }
299    
300            @Override
301            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
302                    _userGroupRole.setPrimaryKeyObj(primaryKeyObj);
303            }
304    
305            /**
306            * Sets the role ID of this user group role.
307            *
308            * @param roleId the role ID of this user group role
309            */
310            @Override
311            public void setRoleId(long roleId) {
312                    _userGroupRole.setRoleId(roleId);
313            }
314    
315            /**
316            * Sets the user ID of this user group role.
317            *
318            * @param userId the user ID of this user group role
319            */
320            @Override
321            public void setUserId(long userId) {
322                    _userGroupRole.setUserId(userId);
323            }
324    
325            /**
326            * Sets the user uuid of this user group role.
327            *
328            * @param userUuid the user uuid of this user group role
329            */
330            @Override
331            public void setUserUuid(java.lang.String userUuid) {
332                    _userGroupRole.setUserUuid(userUuid);
333            }
334    
335            @Override
336            public CacheModel<com.liferay.portal.model.UserGroupRole> toCacheModel() {
337                    return _userGroupRole.toCacheModel();
338            }
339    
340            @Override
341            public com.liferay.portal.model.UserGroupRole toEscapedModel() {
342                    return new UserGroupRoleWrapper(_userGroupRole.toEscapedModel());
343            }
344    
345            @Override
346            public java.lang.String toString() {
347                    return _userGroupRole.toString();
348            }
349    
350            @Override
351            public com.liferay.portal.model.UserGroupRole toUnescapedModel() {
352                    return new UserGroupRoleWrapper(_userGroupRole.toUnescapedModel());
353            }
354    
355            @Override
356            public java.lang.String toXmlString() {
357                    return _userGroupRole.toXmlString();
358            }
359    
360            @Override
361            public boolean equals(Object obj) {
362                    if (this == obj) {
363                            return true;
364                    }
365    
366                    if (!(obj instanceof UserGroupRoleWrapper)) {
367                            return false;
368                    }
369    
370                    UserGroupRoleWrapper userGroupRoleWrapper = (UserGroupRoleWrapper)obj;
371    
372                    if (Validator.equals(_userGroupRole, userGroupRoleWrapper._userGroupRole)) {
373                            return true;
374                    }
375    
376                    return false;
377            }
378    
379            @Override
380            public UserGroupRole getWrappedModel() {
381                    return _userGroupRole;
382            }
383    
384            @Override
385            public boolean isEntityCacheEnabled() {
386                    return _userGroupRole.isEntityCacheEnabled();
387            }
388    
389            @Override
390            public boolean isFinderCacheEnabled() {
391                    return _userGroupRole.isFinderCacheEnabled();
392            }
393    
394            @Override
395            public void resetOriginalValues() {
396                    _userGroupRole.resetOriginalValues();
397            }
398    
399            private final UserGroupRole _userGroupRole;
400    }