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