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