001    /**
002     * Copyright (c) 2000-2013 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("userGroupId", getUserGroupId());
055                    attributes.put("groupId", getGroupId());
056                    attributes.put("roleId", getRoleId());
057    
058                    return attributes;
059            }
060    
061            @Override
062            public void setModelAttributes(Map<String, Object> attributes) {
063                    Long userGroupId = (Long)attributes.get("userGroupId");
064    
065                    if (userGroupId != null) {
066                            setUserGroupId(userGroupId);
067                    }
068    
069                    Long groupId = (Long)attributes.get("groupId");
070    
071                    if (groupId != null) {
072                            setGroupId(groupId);
073                    }
074    
075                    Long roleId = (Long)attributes.get("roleId");
076    
077                    if (roleId != null) {
078                            setRoleId(roleId);
079                    }
080            }
081    
082            /**
083            * Returns the primary key of this user group group role.
084            *
085            * @return the primary key of this user group group role
086            */
087            @Override
088            public com.liferay.portal.service.persistence.UserGroupGroupRolePK getPrimaryKey() {
089                    return _userGroupGroupRole.getPrimaryKey();
090            }
091    
092            /**
093            * Sets the primary key of this user group group role.
094            *
095            * @param primaryKey the primary key of this user group group role
096            */
097            @Override
098            public void setPrimaryKey(
099                    com.liferay.portal.service.persistence.UserGroupGroupRolePK primaryKey) {
100                    _userGroupGroupRole.setPrimaryKey(primaryKey);
101            }
102    
103            /**
104            * Returns the user group ID of this user group group role.
105            *
106            * @return the user group ID of this user group group role
107            */
108            @Override
109            public long getUserGroupId() {
110                    return _userGroupGroupRole.getUserGroupId();
111            }
112    
113            /**
114            * Sets the user group ID of this user group group role.
115            *
116            * @param userGroupId the user group ID of this user group group role
117            */
118            @Override
119            public void setUserGroupId(long userGroupId) {
120                    _userGroupGroupRole.setUserGroupId(userGroupId);
121            }
122    
123            /**
124            * Returns the group ID of this user group group role.
125            *
126            * @return the group ID of this user group group role
127            */
128            @Override
129            public long getGroupId() {
130                    return _userGroupGroupRole.getGroupId();
131            }
132    
133            /**
134            * Sets the group ID of this user group group role.
135            *
136            * @param groupId the group ID of this user group group role
137            */
138            @Override
139            public void setGroupId(long groupId) {
140                    _userGroupGroupRole.setGroupId(groupId);
141            }
142    
143            /**
144            * Returns the role ID of this user group group role.
145            *
146            * @return the role ID of this user group group role
147            */
148            @Override
149            public long getRoleId() {
150                    return _userGroupGroupRole.getRoleId();
151            }
152    
153            /**
154            * Sets the role ID of this user group group role.
155            *
156            * @param roleId the role ID of this user group group role
157            */
158            @Override
159            public void setRoleId(long roleId) {
160                    _userGroupGroupRole.setRoleId(roleId);
161            }
162    
163            @Override
164            public boolean isNew() {
165                    return _userGroupGroupRole.isNew();
166            }
167    
168            @Override
169            public void setNew(boolean n) {
170                    _userGroupGroupRole.setNew(n);
171            }
172    
173            @Override
174            public boolean isCachedModel() {
175                    return _userGroupGroupRole.isCachedModel();
176            }
177    
178            @Override
179            public void setCachedModel(boolean cachedModel) {
180                    _userGroupGroupRole.setCachedModel(cachedModel);
181            }
182    
183            @Override
184            public boolean isEscapedModel() {
185                    return _userGroupGroupRole.isEscapedModel();
186            }
187    
188            @Override
189            public java.io.Serializable getPrimaryKeyObj() {
190                    return _userGroupGroupRole.getPrimaryKeyObj();
191            }
192    
193            @Override
194            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
195                    _userGroupGroupRole.setPrimaryKeyObj(primaryKeyObj);
196            }
197    
198            @Override
199            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
200                    return _userGroupGroupRole.getExpandoBridge();
201            }
202    
203            @Override
204            public void setExpandoBridgeAttributes(
205                    com.liferay.portal.model.BaseModel<?> baseModel) {
206                    _userGroupGroupRole.setExpandoBridgeAttributes(baseModel);
207            }
208    
209            @Override
210            public void setExpandoBridgeAttributes(
211                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
212                    _userGroupGroupRole.setExpandoBridgeAttributes(expandoBridge);
213            }
214    
215            @Override
216            public void setExpandoBridgeAttributes(
217                    com.liferay.portal.service.ServiceContext serviceContext) {
218                    _userGroupGroupRole.setExpandoBridgeAttributes(serviceContext);
219            }
220    
221            @Override
222            public java.lang.Object clone() {
223                    return new UserGroupGroupRoleWrapper((UserGroupGroupRole)_userGroupGroupRole.clone());
224            }
225    
226            @Override
227            public int compareTo(
228                    com.liferay.portal.model.UserGroupGroupRole userGroupGroupRole) {
229                    return _userGroupGroupRole.compareTo(userGroupGroupRole);
230            }
231    
232            @Override
233            public int hashCode() {
234                    return _userGroupGroupRole.hashCode();
235            }
236    
237            @Override
238            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.UserGroupGroupRole> toCacheModel() {
239                    return _userGroupGroupRole.toCacheModel();
240            }
241    
242            @Override
243            public com.liferay.portal.model.UserGroupGroupRole toEscapedModel() {
244                    return new UserGroupGroupRoleWrapper(_userGroupGroupRole.toEscapedModel());
245            }
246    
247            @Override
248            public com.liferay.portal.model.UserGroupGroupRole toUnescapedModel() {
249                    return new UserGroupGroupRoleWrapper(_userGroupGroupRole.toUnescapedModel());
250            }
251    
252            @Override
253            public java.lang.String toString() {
254                    return _userGroupGroupRole.toString();
255            }
256    
257            @Override
258            public java.lang.String toXmlString() {
259                    return _userGroupGroupRole.toXmlString();
260            }
261    
262            @Override
263            public void persist()
264                    throws com.liferay.portal.kernel.exception.SystemException {
265                    _userGroupGroupRole.persist();
266            }
267    
268            @Override
269            public com.liferay.portal.model.Group getGroup()
270                    throws com.liferay.portal.kernel.exception.PortalException,
271                            com.liferay.portal.kernel.exception.SystemException {
272                    return _userGroupGroupRole.getGroup();
273            }
274    
275            @Override
276            public com.liferay.portal.model.Role getRole()
277                    throws com.liferay.portal.kernel.exception.PortalException,
278                            com.liferay.portal.kernel.exception.SystemException {
279                    return _userGroupGroupRole.getRole();
280            }
281    
282            @Override
283            public com.liferay.portal.model.UserGroup getUserGroup()
284                    throws com.liferay.portal.kernel.exception.PortalException,
285                            com.liferay.portal.kernel.exception.SystemException {
286                    return _userGroupGroupRole.getUserGroup();
287            }
288    
289            @Override
290            public boolean equals(Object obj) {
291                    if (this == obj) {
292                            return true;
293                    }
294    
295                    if (!(obj instanceof UserGroupGroupRoleWrapper)) {
296                            return false;
297                    }
298    
299                    UserGroupGroupRoleWrapper userGroupGroupRoleWrapper = (UserGroupGroupRoleWrapper)obj;
300    
301                    if (Validator.equals(_userGroupGroupRole,
302                                            userGroupGroupRoleWrapper._userGroupGroupRole)) {
303                            return true;
304                    }
305    
306                    return false;
307            }
308    
309            /**
310             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
311             */
312            public UserGroupGroupRole getWrappedUserGroupGroupRole() {
313                    return _userGroupGroupRole;
314            }
315    
316            @Override
317            public UserGroupGroupRole getWrappedModel() {
318                    return _userGroupGroupRole;
319            }
320    
321            @Override
322            public void resetOriginalValues() {
323                    _userGroupGroupRole.resetOriginalValues();
324            }
325    
326            private UserGroupGroupRole _userGroupGroupRole;
327    }