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 UserGroupGroupRole}.
027     * </p>
028     *
029     * @author Brian Wing Shun Chan
030     * @see UserGroupGroupRole
031     * @generated
032     */
033    @ProviderType
034    public class UserGroupGroupRoleWrapper implements UserGroupGroupRole,
035            ModelWrapper<UserGroupGroupRole> {
036            public UserGroupGroupRoleWrapper(UserGroupGroupRole userGroupGroupRole) {
037                    _userGroupGroupRole = userGroupGroupRole;
038            }
039    
040            @Override
041            public Class<?> getModelClass() {
042                    return UserGroupGroupRole.class;
043            }
044    
045            @Override
046            public String getModelClassName() {
047                    return UserGroupGroupRole.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("userGroupId", getUserGroupId());
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 userGroupId = (Long)attributes.get("userGroupId");
071    
072                    if (userGroupId != null) {
073                            setUserGroupId(userGroupId);
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 UserGroupGroupRoleWrapper((UserGroupGroupRole)_userGroupGroupRole.clone());
092            }
093    
094            @Override
095            public int compareTo(
096                    com.liferay.portal.model.UserGroupGroupRole userGroupGroupRole) {
097                    return _userGroupGroupRole.compareTo(userGroupGroupRole);
098            }
099    
100            @Override
101            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
102                    return _userGroupGroupRole.getExpandoBridge();
103            }
104    
105            @Override
106            public com.liferay.portal.model.Group getGroup()
107                    throws com.liferay.portal.kernel.exception.PortalException {
108                    return _userGroupGroupRole.getGroup();
109            }
110    
111            /**
112            * Returns the group ID of this user group group role.
113            *
114            * @return the group ID of this user group group role
115            */
116            @Override
117            public long getGroupId() {
118                    return _userGroupGroupRole.getGroupId();
119            }
120    
121            /**
122            * Returns the mvcc version of this user group group role.
123            *
124            * @return the mvcc version of this user group group role
125            */
126            @Override
127            public long getMvccVersion() {
128                    return _userGroupGroupRole.getMvccVersion();
129            }
130    
131            /**
132            * Returns the primary key of this user group group role.
133            *
134            * @return the primary key of this user group group role
135            */
136            @Override
137            public com.liferay.portal.service.persistence.UserGroupGroupRolePK getPrimaryKey() {
138                    return _userGroupGroupRole.getPrimaryKey();
139            }
140    
141            @Override
142            public java.io.Serializable getPrimaryKeyObj() {
143                    return _userGroupGroupRole.getPrimaryKeyObj();
144            }
145    
146            @Override
147            public com.liferay.portal.model.Role getRole()
148                    throws com.liferay.portal.kernel.exception.PortalException {
149                    return _userGroupGroupRole.getRole();
150            }
151    
152            /**
153            * Returns the role ID of this user group group role.
154            *
155            * @return the role ID of this user group group role
156            */
157            @Override
158            public long getRoleId() {
159                    return _userGroupGroupRole.getRoleId();
160            }
161    
162            @Override
163            public com.liferay.portal.model.UserGroup getUserGroup()
164                    throws com.liferay.portal.kernel.exception.PortalException {
165                    return _userGroupGroupRole.getUserGroup();
166            }
167    
168            /**
169            * Returns the user group ID of this user group group role.
170            *
171            * @return the user group ID of this user group group role
172            */
173            @Override
174            public long getUserGroupId() {
175                    return _userGroupGroupRole.getUserGroupId();
176            }
177    
178            @Override
179            public int hashCode() {
180                    return _userGroupGroupRole.hashCode();
181            }
182    
183            @Override
184            public boolean isCachedModel() {
185                    return _userGroupGroupRole.isCachedModel();
186            }
187    
188            @Override
189            public boolean isEscapedModel() {
190                    return _userGroupGroupRole.isEscapedModel();
191            }
192    
193            @Override
194            public boolean isNew() {
195                    return _userGroupGroupRole.isNew();
196            }
197    
198            @Override
199            public void persist() {
200                    _userGroupGroupRole.persist();
201            }
202    
203            @Override
204            public void setCachedModel(boolean cachedModel) {
205                    _userGroupGroupRole.setCachedModel(cachedModel);
206            }
207    
208            @Override
209            public void setExpandoBridgeAttributes(
210                    com.liferay.portal.model.BaseModel<?> baseModel) {
211                    _userGroupGroupRole.setExpandoBridgeAttributes(baseModel);
212            }
213    
214            @Override
215            public void setExpandoBridgeAttributes(
216                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
217                    _userGroupGroupRole.setExpandoBridgeAttributes(expandoBridge);
218            }
219    
220            @Override
221            public void setExpandoBridgeAttributes(
222                    com.liferay.portal.service.ServiceContext serviceContext) {
223                    _userGroupGroupRole.setExpandoBridgeAttributes(serviceContext);
224            }
225    
226            /**
227            * Sets the group ID of this user group group role.
228            *
229            * @param groupId the group ID of this user group group role
230            */
231            @Override
232            public void setGroupId(long groupId) {
233                    _userGroupGroupRole.setGroupId(groupId);
234            }
235    
236            /**
237            * Sets the mvcc version of this user group group role.
238            *
239            * @param mvccVersion the mvcc version of this user group group role
240            */
241            @Override
242            public void setMvccVersion(long mvccVersion) {
243                    _userGroupGroupRole.setMvccVersion(mvccVersion);
244            }
245    
246            @Override
247            public void setNew(boolean n) {
248                    _userGroupGroupRole.setNew(n);
249            }
250    
251            /**
252            * Sets the primary key of this user group group role.
253            *
254            * @param primaryKey the primary key of this user group group role
255            */
256            @Override
257            public void setPrimaryKey(
258                    com.liferay.portal.service.persistence.UserGroupGroupRolePK primaryKey) {
259                    _userGroupGroupRole.setPrimaryKey(primaryKey);
260            }
261    
262            @Override
263            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
264                    _userGroupGroupRole.setPrimaryKeyObj(primaryKeyObj);
265            }
266    
267            /**
268            * Sets the role ID of this user group group role.
269            *
270            * @param roleId the role ID of this user group group role
271            */
272            @Override
273            public void setRoleId(long roleId) {
274                    _userGroupGroupRole.setRoleId(roleId);
275            }
276    
277            /**
278            * Sets the user group ID of this user group group role.
279            *
280            * @param userGroupId the user group ID of this user group group role
281            */
282            @Override
283            public void setUserGroupId(long userGroupId) {
284                    _userGroupGroupRole.setUserGroupId(userGroupId);
285            }
286    
287            @Override
288            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.UserGroupGroupRole> toCacheModel() {
289                    return _userGroupGroupRole.toCacheModel();
290            }
291    
292            @Override
293            public com.liferay.portal.model.UserGroupGroupRole toEscapedModel() {
294                    return new UserGroupGroupRoleWrapper(_userGroupGroupRole.toEscapedModel());
295            }
296    
297            @Override
298            public java.lang.String toString() {
299                    return _userGroupGroupRole.toString();
300            }
301    
302            @Override
303            public com.liferay.portal.model.UserGroupGroupRole toUnescapedModel() {
304                    return new UserGroupGroupRoleWrapper(_userGroupGroupRole.toUnescapedModel());
305            }
306    
307            @Override
308            public java.lang.String toXmlString() {
309                    return _userGroupGroupRole.toXmlString();
310            }
311    
312            @Override
313            public boolean equals(Object obj) {
314                    if (this == obj) {
315                            return true;
316                    }
317    
318                    if (!(obj instanceof UserGroupGroupRoleWrapper)) {
319                            return false;
320                    }
321    
322                    UserGroupGroupRoleWrapper userGroupGroupRoleWrapper = (UserGroupGroupRoleWrapper)obj;
323    
324                    if (Validator.equals(_userGroupGroupRole,
325                                            userGroupGroupRoleWrapper._userGroupGroupRole)) {
326                            return true;
327                    }
328    
329                    return false;
330            }
331    
332            /**
333             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
334             */
335            @Deprecated
336            public UserGroupGroupRole getWrappedUserGroupGroupRole() {
337                    return _userGroupGroupRole;
338            }
339    
340            @Override
341            public UserGroupGroupRole getWrappedModel() {
342                    return _userGroupGroupRole;
343            }
344    
345            @Override
346            public boolean isEntityCacheEnabled() {
347                    return _userGroupGroupRole.isEntityCacheEnabled();
348            }
349    
350            @Override
351            public boolean isFinderCacheEnabled() {
352                    return _userGroupGroupRole.isFinderCacheEnabled();
353            }
354    
355            @Override
356            public void resetOriginalValues() {
357                    _userGroupGroupRole.resetOriginalValues();
358            }
359    
360            private final UserGroupGroupRole _userGroupGroupRole;
361    }