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