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