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