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(BaseModel<?> baseModel) {
219                    _userGroupRole.setExpandoBridgeAttributes(baseModel);
220            }
221    
222            @Override
223            public void setExpandoBridgeAttributes(
224                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
225                    _userGroupRole.setExpandoBridgeAttributes(expandoBridge);
226            }
227    
228            @Override
229            public void setExpandoBridgeAttributes(
230                    com.liferay.portal.service.ServiceContext serviceContext) {
231                    _userGroupRole.setExpandoBridgeAttributes(serviceContext);
232            }
233    
234            /**
235            * Sets the group ID of this user group role.
236            *
237            * @param groupId the group ID of this user group role
238            */
239            @Override
240            public void setGroupId(long groupId) {
241                    _userGroupRole.setGroupId(groupId);
242            }
243    
244            /**
245            * Sets the mvcc version of this user group role.
246            *
247            * @param mvccVersion the mvcc version of this user group role
248            */
249            @Override
250            public void setMvccVersion(long mvccVersion) {
251                    _userGroupRole.setMvccVersion(mvccVersion);
252            }
253    
254            @Override
255            public void setNew(boolean n) {
256                    _userGroupRole.setNew(n);
257            }
258    
259            /**
260            * Sets the primary key of this user group role.
261            *
262            * @param primaryKey the primary key of this user group role
263            */
264            @Override
265            public void setPrimaryKey(
266                    com.liferay.portal.service.persistence.UserGroupRolePK primaryKey) {
267                    _userGroupRole.setPrimaryKey(primaryKey);
268            }
269    
270            @Override
271            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
272                    _userGroupRole.setPrimaryKeyObj(primaryKeyObj);
273            }
274    
275            /**
276            * Sets the role ID of this user group role.
277            *
278            * @param roleId the role ID of this user group role
279            */
280            @Override
281            public void setRoleId(long roleId) {
282                    _userGroupRole.setRoleId(roleId);
283            }
284    
285            /**
286            * Sets the user ID of this user group role.
287            *
288            * @param userId the user ID of this user group role
289            */
290            @Override
291            public void setUserId(long userId) {
292                    _userGroupRole.setUserId(userId);
293            }
294    
295            /**
296            * Sets the user uuid of this user group role.
297            *
298            * @param userUuid the user uuid of this user group role
299            */
300            @Override
301            public void setUserUuid(java.lang.String userUuid) {
302                    _userGroupRole.setUserUuid(userUuid);
303            }
304    
305            @Override
306            public CacheModel<com.liferay.portal.model.UserGroupRole> toCacheModel() {
307                    return _userGroupRole.toCacheModel();
308            }
309    
310            @Override
311            public com.liferay.portal.model.UserGroupRole toEscapedModel() {
312                    return new UserGroupRoleWrapper(_userGroupRole.toEscapedModel());
313            }
314    
315            @Override
316            public java.lang.String toString() {
317                    return _userGroupRole.toString();
318            }
319    
320            @Override
321            public com.liferay.portal.model.UserGroupRole toUnescapedModel() {
322                    return new UserGroupRoleWrapper(_userGroupRole.toUnescapedModel());
323            }
324    
325            @Override
326            public java.lang.String toXmlString() {
327                    return _userGroupRole.toXmlString();
328            }
329    
330            @Override
331            public boolean equals(Object obj) {
332                    if (this == obj) {
333                            return true;
334                    }
335    
336                    if (!(obj instanceof UserGroupRoleWrapper)) {
337                            return false;
338                    }
339    
340                    UserGroupRoleWrapper userGroupRoleWrapper = (UserGroupRoleWrapper)obj;
341    
342                    if (Validator.equals(_userGroupRole, userGroupRoleWrapper._userGroupRole)) {
343                            return true;
344                    }
345    
346                    return false;
347            }
348    
349            /**
350             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
351             */
352            @Deprecated
353            public UserGroupRole getWrappedUserGroupRole() {
354                    return _userGroupRole;
355            }
356    
357            @Override
358            public UserGroupRole getWrappedModel() {
359                    return _userGroupRole;
360            }
361    
362            @Override
363            public boolean isEntityCacheEnabled() {
364                    return _userGroupRole.isEntityCacheEnabled();
365            }
366    
367            @Override
368            public boolean isFinderCacheEnabled() {
369                    return _userGroupRole.isFinderCacheEnabled();
370            }
371    
372            @Override
373            public void resetOriginalValues() {
374                    _userGroupRole.resetOriginalValues();
375            }
376    
377            private final UserGroupRole _userGroupRole;
378    }