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