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 com.liferay.portal.kernel.util.Validator;
018    
019    import java.util.HashMap;
020    import java.util.Map;
021    
022    /**
023     * <p>
024     * This class is a wrapper for {@link UserGroupGroupRole}.
025     * </p>
026     *
027     * @author Brian Wing Shun Chan
028     * @see UserGroupGroupRole
029     * @generated
030     */
031    public class UserGroupGroupRoleWrapper implements UserGroupGroupRole,
032            ModelWrapper<UserGroupGroupRole> {
033            public UserGroupGroupRoleWrapper(UserGroupGroupRole userGroupGroupRole) {
034                    _userGroupGroupRole = userGroupGroupRole;
035            }
036    
037            @Override
038            public Class<?> getModelClass() {
039                    return UserGroupGroupRole.class;
040            }
041    
042            @Override
043            public String getModelClassName() {
044                    return UserGroupGroupRole.class.getName();
045            }
046    
047            @Override
048            public Map<String, Object> getModelAttributes() {
049                    Map<String, Object> attributes = new HashMap<String, Object>();
050    
051                    attributes.put("userGroupId", getUserGroupId());
052                    attributes.put("groupId", getGroupId());
053                    attributes.put("roleId", getRoleId());
054    
055                    return attributes;
056            }
057    
058            @Override
059            public void setModelAttributes(Map<String, Object> attributes) {
060                    Long userGroupId = (Long)attributes.get("userGroupId");
061    
062                    if (userGroupId != null) {
063                            setUserGroupId(userGroupId);
064                    }
065    
066                    Long groupId = (Long)attributes.get("groupId");
067    
068                    if (groupId != null) {
069                            setGroupId(groupId);
070                    }
071    
072                    Long roleId = (Long)attributes.get("roleId");
073    
074                    if (roleId != null) {
075                            setRoleId(roleId);
076                    }
077            }
078    
079            /**
080            * Returns the primary key of this user group group role.
081            *
082            * @return the primary key of this user group group role
083            */
084            @Override
085            public com.liferay.portal.service.persistence.UserGroupGroupRolePK getPrimaryKey() {
086                    return _userGroupGroupRole.getPrimaryKey();
087            }
088    
089            /**
090            * Sets the primary key of this user group group role.
091            *
092            * @param primaryKey the primary key of this user group group role
093            */
094            @Override
095            public void setPrimaryKey(
096                    com.liferay.portal.service.persistence.UserGroupGroupRolePK primaryKey) {
097                    _userGroupGroupRole.setPrimaryKey(primaryKey);
098            }
099    
100            /**
101            * Returns the user group ID of this user group group role.
102            *
103            * @return the user group ID of this user group group role
104            */
105            @Override
106            public long getUserGroupId() {
107                    return _userGroupGroupRole.getUserGroupId();
108            }
109    
110            /**
111            * Sets the user group ID of this user group group role.
112            *
113            * @param userGroupId the user group ID of this user group group role
114            */
115            @Override
116            public void setUserGroupId(long userGroupId) {
117                    _userGroupGroupRole.setUserGroupId(userGroupId);
118            }
119    
120            /**
121            * Returns the group ID of this user group group role.
122            *
123            * @return the group ID of this user group group role
124            */
125            @Override
126            public long getGroupId() {
127                    return _userGroupGroupRole.getGroupId();
128            }
129    
130            /**
131            * Sets the group ID of this user group group role.
132            *
133            * @param groupId the group ID of this user group group role
134            */
135            @Override
136            public void setGroupId(long groupId) {
137                    _userGroupGroupRole.setGroupId(groupId);
138            }
139    
140            /**
141            * Returns the role ID of this user group group role.
142            *
143            * @return the role ID of this user group group role
144            */
145            @Override
146            public long getRoleId() {
147                    return _userGroupGroupRole.getRoleId();
148            }
149    
150            /**
151            * Sets the role ID of this user group group role.
152            *
153            * @param roleId the role ID of this user group group role
154            */
155            @Override
156            public void setRoleId(long roleId) {
157                    _userGroupGroupRole.setRoleId(roleId);
158            }
159    
160            @Override
161            public boolean isNew() {
162                    return _userGroupGroupRole.isNew();
163            }
164    
165            @Override
166            public void setNew(boolean n) {
167                    _userGroupGroupRole.setNew(n);
168            }
169    
170            @Override
171            public boolean isCachedModel() {
172                    return _userGroupGroupRole.isCachedModel();
173            }
174    
175            @Override
176            public void setCachedModel(boolean cachedModel) {
177                    _userGroupGroupRole.setCachedModel(cachedModel);
178            }
179    
180            @Override
181            public boolean isEscapedModel() {
182                    return _userGroupGroupRole.isEscapedModel();
183            }
184    
185            @Override
186            public java.io.Serializable getPrimaryKeyObj() {
187                    return _userGroupGroupRole.getPrimaryKeyObj();
188            }
189    
190            @Override
191            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
192                    _userGroupGroupRole.setPrimaryKeyObj(primaryKeyObj);
193            }
194    
195            @Override
196            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
197                    return _userGroupGroupRole.getExpandoBridge();
198            }
199    
200            @Override
201            public void setExpandoBridgeAttributes(
202                    com.liferay.portal.model.BaseModel<?> baseModel) {
203                    _userGroupGroupRole.setExpandoBridgeAttributes(baseModel);
204            }
205    
206            @Override
207            public void setExpandoBridgeAttributes(
208                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
209                    _userGroupGroupRole.setExpandoBridgeAttributes(expandoBridge);
210            }
211    
212            @Override
213            public void setExpandoBridgeAttributes(
214                    com.liferay.portal.service.ServiceContext serviceContext) {
215                    _userGroupGroupRole.setExpandoBridgeAttributes(serviceContext);
216            }
217    
218            @Override
219            public java.lang.Object clone() {
220                    return new UserGroupGroupRoleWrapper((UserGroupGroupRole)_userGroupGroupRole.clone());
221            }
222    
223            @Override
224            public int compareTo(
225                    com.liferay.portal.model.UserGroupGroupRole userGroupGroupRole) {
226                    return _userGroupGroupRole.compareTo(userGroupGroupRole);
227            }
228    
229            @Override
230            public int hashCode() {
231                    return _userGroupGroupRole.hashCode();
232            }
233    
234            @Override
235            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.UserGroupGroupRole> toCacheModel() {
236                    return _userGroupGroupRole.toCacheModel();
237            }
238    
239            @Override
240            public com.liferay.portal.model.UserGroupGroupRole toEscapedModel() {
241                    return new UserGroupGroupRoleWrapper(_userGroupGroupRole.toEscapedModel());
242            }
243    
244            @Override
245            public com.liferay.portal.model.UserGroupGroupRole toUnescapedModel() {
246                    return new UserGroupGroupRoleWrapper(_userGroupGroupRole.toUnescapedModel());
247            }
248    
249            @Override
250            public java.lang.String toString() {
251                    return _userGroupGroupRole.toString();
252            }
253    
254            @Override
255            public java.lang.String toXmlString() {
256                    return _userGroupGroupRole.toXmlString();
257            }
258    
259            @Override
260            public void persist()
261                    throws com.liferay.portal.kernel.exception.SystemException {
262                    _userGroupGroupRole.persist();
263            }
264    
265            @Override
266            public boolean equals(Object obj) {
267                    if (this == obj) {
268                            return true;
269                    }
270    
271                    if (!(obj instanceof UserGroupGroupRoleWrapper)) {
272                            return false;
273                    }
274    
275                    UserGroupGroupRoleWrapper userGroupGroupRoleWrapper = (UserGroupGroupRoleWrapper)obj;
276    
277                    if (Validator.equals(_userGroupGroupRole,
278                                            userGroupGroupRoleWrapper._userGroupGroupRole)) {
279                            return true;
280                    }
281    
282                    return false;
283            }
284    
285            /**
286             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
287             */
288            public UserGroupGroupRole getWrappedUserGroupGroupRole() {
289                    return _userGroupGroupRole;
290            }
291    
292            @Override
293            public UserGroupGroupRole getWrappedModel() {
294                    return _userGroupGroupRole;
295            }
296    
297            @Override
298            public void resetOriginalValues() {
299                    _userGroupGroupRole.resetOriginalValues();
300            }
301    
302            private UserGroupGroupRole _userGroupGroupRole;
303    }