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            @Override
038            public Class<?> getModelClass() {
039                    return OrgGroupRole.class;
040            }
041    
042            @Override
043            public String getModelClassName() {
044                    return OrgGroupRole.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("organizationId", getOrganizationId());
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 organizationId = (Long)attributes.get("organizationId");
061    
062                    if (organizationId != null) {
063                            setOrganizationId(organizationId);
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 org group role.
081            *
082            * @return the primary key of this org group role
083            */
084            @Override
085            public com.liferay.portal.service.persistence.OrgGroupRolePK getPrimaryKey() {
086                    return _orgGroupRole.getPrimaryKey();
087            }
088    
089            /**
090            * Sets the primary key of this org group role.
091            *
092            * @param primaryKey the primary key of this org group role
093            */
094            @Override
095            public void setPrimaryKey(
096                    com.liferay.portal.service.persistence.OrgGroupRolePK primaryKey) {
097                    _orgGroupRole.setPrimaryKey(primaryKey);
098            }
099    
100            /**
101            * Returns the organization ID of this org group role.
102            *
103            * @return the organization ID of this org group role
104            */
105            @Override
106            public long getOrganizationId() {
107                    return _orgGroupRole.getOrganizationId();
108            }
109    
110            /**
111            * Sets the organization ID of this org group role.
112            *
113            * @param organizationId the organization ID of this org group role
114            */
115            @Override
116            public void setOrganizationId(long organizationId) {
117                    _orgGroupRole.setOrganizationId(organizationId);
118            }
119    
120            /**
121            * Returns the group ID of this org group role.
122            *
123            * @return the group ID of this org group role
124            */
125            @Override
126            public long getGroupId() {
127                    return _orgGroupRole.getGroupId();
128            }
129    
130            /**
131            * Sets the group ID of this org group role.
132            *
133            * @param groupId the group ID of this org group role
134            */
135            @Override
136            public void setGroupId(long groupId) {
137                    _orgGroupRole.setGroupId(groupId);
138            }
139    
140            /**
141            * Returns the role ID of this org group role.
142            *
143            * @return the role ID of this org group role
144            */
145            @Override
146            public long getRoleId() {
147                    return _orgGroupRole.getRoleId();
148            }
149    
150            /**
151            * Sets the role ID of this org group role.
152            *
153            * @param roleId the role ID of this org group role
154            */
155            @Override
156            public void setRoleId(long roleId) {
157                    _orgGroupRole.setRoleId(roleId);
158            }
159    
160            @Override
161            public boolean isNew() {
162                    return _orgGroupRole.isNew();
163            }
164    
165            @Override
166            public void setNew(boolean n) {
167                    _orgGroupRole.setNew(n);
168            }
169    
170            @Override
171            public boolean isCachedModel() {
172                    return _orgGroupRole.isCachedModel();
173            }
174    
175            @Override
176            public void setCachedModel(boolean cachedModel) {
177                    _orgGroupRole.setCachedModel(cachedModel);
178            }
179    
180            @Override
181            public boolean isEscapedModel() {
182                    return _orgGroupRole.isEscapedModel();
183            }
184    
185            @Override
186            public java.io.Serializable getPrimaryKeyObj() {
187                    return _orgGroupRole.getPrimaryKeyObj();
188            }
189    
190            @Override
191            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
192                    _orgGroupRole.setPrimaryKeyObj(primaryKeyObj);
193            }
194    
195            @Override
196            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
197                    return _orgGroupRole.getExpandoBridge();
198            }
199    
200            @Override
201            public void setExpandoBridgeAttributes(
202                    com.liferay.portal.model.BaseModel<?> baseModel) {
203                    _orgGroupRole.setExpandoBridgeAttributes(baseModel);
204            }
205    
206            @Override
207            public void setExpandoBridgeAttributes(
208                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
209                    _orgGroupRole.setExpandoBridgeAttributes(expandoBridge);
210            }
211    
212            @Override
213            public void setExpandoBridgeAttributes(
214                    com.liferay.portal.service.ServiceContext serviceContext) {
215                    _orgGroupRole.setExpandoBridgeAttributes(serviceContext);
216            }
217    
218            @Override
219            public java.lang.Object clone() {
220                    return new OrgGroupRoleWrapper((OrgGroupRole)_orgGroupRole.clone());
221            }
222    
223            @Override
224            public int compareTo(com.liferay.portal.model.OrgGroupRole orgGroupRole) {
225                    return _orgGroupRole.compareTo(orgGroupRole);
226            }
227    
228            @Override
229            public int hashCode() {
230                    return _orgGroupRole.hashCode();
231            }
232    
233            @Override
234            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.OrgGroupRole> toCacheModel() {
235                    return _orgGroupRole.toCacheModel();
236            }
237    
238            @Override
239            public com.liferay.portal.model.OrgGroupRole toEscapedModel() {
240                    return new OrgGroupRoleWrapper(_orgGroupRole.toEscapedModel());
241            }
242    
243            @Override
244            public com.liferay.portal.model.OrgGroupRole toUnescapedModel() {
245                    return new OrgGroupRoleWrapper(_orgGroupRole.toUnescapedModel());
246            }
247    
248            @Override
249            public java.lang.String toString() {
250                    return _orgGroupRole.toString();
251            }
252    
253            @Override
254            public java.lang.String toXmlString() {
255                    return _orgGroupRole.toXmlString();
256            }
257    
258            @Override
259            public boolean containsGroup(
260                    java.util.List<com.liferay.portal.model.Group> groups) {
261                    return _orgGroupRole.containsGroup(groups);
262            }
263    
264            @Override
265            public boolean containsOrganization(
266                    java.util.List<com.liferay.portal.model.Organization> organizations) {
267                    return _orgGroupRole.containsOrganization(organizations);
268            }
269    
270            @Override
271            public boolean equals(Object obj) {
272                    if (this == obj) {
273                            return true;
274                    }
275    
276                    if (!(obj instanceof OrgGroupRoleWrapper)) {
277                            return false;
278                    }
279    
280                    OrgGroupRoleWrapper orgGroupRoleWrapper = (OrgGroupRoleWrapper)obj;
281    
282                    if (Validator.equals(_orgGroupRole, orgGroupRoleWrapper._orgGroupRole)) {
283                            return true;
284                    }
285    
286                    return false;
287            }
288    
289            /**
290             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
291             */
292            public OrgGroupRole getWrappedOrgGroupRole() {
293                    return _orgGroupRole;
294            }
295    
296            @Override
297            public OrgGroupRole getWrappedModel() {
298                    return _orgGroupRole;
299            }
300    
301            @Override
302            public void resetOriginalValues() {
303                    _orgGroupRole.resetOriginalValues();
304            }
305    
306            private OrgGroupRole _orgGroupRole;
307    }