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 OrgGroupRole}.
025     * </p>
026     *
027     * @author    Brian Wing Shun Chan
028     * @see       OrgGroupRole
029     * @generated
030     */
031    public class OrgGroupRoleWrapper implements OrgGroupRole,
032            ModelWrapper<OrgGroupRole> {
033            public OrgGroupRoleWrapper(OrgGroupRole orgGroupRole) {
034                    _orgGroupRole = orgGroupRole;
035            }
036    
037            public Class<?> getModelClass() {
038                    return OrgGroupRole.class;
039            }
040    
041            public String getModelClassName() {
042                    return OrgGroupRole.class.getName();
043            }
044    
045            public Map<String, Object> getModelAttributes() {
046                    Map<String, Object> attributes = new HashMap<String, Object>();
047    
048                    attributes.put("organizationId", getOrganizationId());
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 organizationId = (Long)attributes.get("organizationId");
057    
058                    if (organizationId != null) {
059                            setOrganizationId(organizationId);
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 org group role.
077            *
078            * @return the primary key of this org group role
079            */
080            public com.liferay.portal.service.persistence.OrgGroupRolePK getPrimaryKey() {
081                    return _orgGroupRole.getPrimaryKey();
082            }
083    
084            /**
085            * Sets the primary key of this org group role.
086            *
087            * @param primaryKey the primary key of this org group role
088            */
089            public void setPrimaryKey(
090                    com.liferay.portal.service.persistence.OrgGroupRolePK primaryKey) {
091                    _orgGroupRole.setPrimaryKey(primaryKey);
092            }
093    
094            /**
095            * Returns the organization ID of this org group role.
096            *
097            * @return the organization ID of this org group role
098            */
099            public long getOrganizationId() {
100                    return _orgGroupRole.getOrganizationId();
101            }
102    
103            /**
104            * Sets the organization ID of this org group role.
105            *
106            * @param organizationId the organization ID of this org group role
107            */
108            public void setOrganizationId(long organizationId) {
109                    _orgGroupRole.setOrganizationId(organizationId);
110            }
111    
112            /**
113            * Returns the group ID of this org group role.
114            *
115            * @return the group ID of this org group role
116            */
117            public long getGroupId() {
118                    return _orgGroupRole.getGroupId();
119            }
120    
121            /**
122            * Sets the group ID of this org group role.
123            *
124            * @param groupId the group ID of this org group role
125            */
126            public void setGroupId(long groupId) {
127                    _orgGroupRole.setGroupId(groupId);
128            }
129    
130            /**
131            * Returns the role ID of this org group role.
132            *
133            * @return the role ID of this org group role
134            */
135            public long getRoleId() {
136                    return _orgGroupRole.getRoleId();
137            }
138    
139            /**
140            * Sets the role ID of this org group role.
141            *
142            * @param roleId the role ID of this org group role
143            */
144            public void setRoleId(long roleId) {
145                    _orgGroupRole.setRoleId(roleId);
146            }
147    
148            public boolean isNew() {
149                    return _orgGroupRole.isNew();
150            }
151    
152            public void setNew(boolean n) {
153                    _orgGroupRole.setNew(n);
154            }
155    
156            public boolean isCachedModel() {
157                    return _orgGroupRole.isCachedModel();
158            }
159    
160            public void setCachedModel(boolean cachedModel) {
161                    _orgGroupRole.setCachedModel(cachedModel);
162            }
163    
164            public boolean isEscapedModel() {
165                    return _orgGroupRole.isEscapedModel();
166            }
167    
168            public java.io.Serializable getPrimaryKeyObj() {
169                    return _orgGroupRole.getPrimaryKeyObj();
170            }
171    
172            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
173                    _orgGroupRole.setPrimaryKeyObj(primaryKeyObj);
174            }
175    
176            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
177                    return _orgGroupRole.getExpandoBridge();
178            }
179    
180            public void setExpandoBridgeAttributes(
181                    com.liferay.portal.service.ServiceContext serviceContext) {
182                    _orgGroupRole.setExpandoBridgeAttributes(serviceContext);
183            }
184    
185            @Override
186            public java.lang.Object clone() {
187                    return new OrgGroupRoleWrapper((OrgGroupRole)_orgGroupRole.clone());
188            }
189    
190            public int compareTo(com.liferay.portal.model.OrgGroupRole orgGroupRole) {
191                    return _orgGroupRole.compareTo(orgGroupRole);
192            }
193    
194            @Override
195            public int hashCode() {
196                    return _orgGroupRole.hashCode();
197            }
198    
199            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.OrgGroupRole> toCacheModel() {
200                    return _orgGroupRole.toCacheModel();
201            }
202    
203            public com.liferay.portal.model.OrgGroupRole toEscapedModel() {
204                    return new OrgGroupRoleWrapper(_orgGroupRole.toEscapedModel());
205            }
206    
207            public com.liferay.portal.model.OrgGroupRole toUnescapedModel() {
208                    return new OrgGroupRoleWrapper(_orgGroupRole.toUnescapedModel());
209            }
210    
211            @Override
212            public java.lang.String toString() {
213                    return _orgGroupRole.toString();
214            }
215    
216            public java.lang.String toXmlString() {
217                    return _orgGroupRole.toXmlString();
218            }
219    
220            public boolean containsGroup(
221                    java.util.List<com.liferay.portal.model.Group> groups) {
222                    return _orgGroupRole.containsGroup(groups);
223            }
224    
225            public boolean containsOrganization(
226                    java.util.List<com.liferay.portal.model.Organization> organizations) {
227                    return _orgGroupRole.containsOrganization(organizations);
228            }
229    
230            @Override
231            public boolean equals(Object obj) {
232                    if (this == obj) {
233                            return true;
234                    }
235    
236                    if (!(obj instanceof OrgGroupRoleWrapper)) {
237                            return false;
238                    }
239    
240                    OrgGroupRoleWrapper orgGroupRoleWrapper = (OrgGroupRoleWrapper)obj;
241    
242                    if (Validator.equals(_orgGroupRole, orgGroupRoleWrapper._orgGroupRole)) {
243                            return true;
244                    }
245    
246                    return false;
247            }
248    
249            /**
250             * @deprecated Renamed to {@link #getWrappedModel}
251             */
252            public OrgGroupRole getWrappedOrgGroupRole() {
253                    return _orgGroupRole;
254            }
255    
256            public OrgGroupRole getWrappedModel() {
257                    return _orgGroupRole;
258            }
259    
260            public void resetOriginalValues() {
261                    _orgGroupRole.resetOriginalValues();
262            }
263    
264            private OrgGroupRole _orgGroupRole;
265    }