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