001    /**
002     * Copyright (c) 2000-present 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 OrgGroupRole}.
027     * </p>
028     *
029     * @author Brian Wing Shun Chan
030     * @see OrgGroupRole
031     * @generated
032     */
033    @ProviderType
034    public class OrgGroupRoleWrapper implements OrgGroupRole,
035            ModelWrapper<OrgGroupRole> {
036            public OrgGroupRoleWrapper(OrgGroupRole orgGroupRole) {
037                    _orgGroupRole = orgGroupRole;
038            }
039    
040            @Override
041            public Class<?> getModelClass() {
042                    return OrgGroupRole.class;
043            }
044    
045            @Override
046            public String getModelClassName() {
047                    return OrgGroupRole.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("mvccVersion", getMvccVersion());
055                    attributes.put("organizationId", getOrganizationId());
056                    attributes.put("groupId", getGroupId());
057                    attributes.put("roleId", getRoleId());
058                    attributes.put("companyId", getCompanyId());
059    
060                    return attributes;
061            }
062    
063            @Override
064            public void setModelAttributes(Map<String, Object> attributes) {
065                    Long mvccVersion = (Long)attributes.get("mvccVersion");
066    
067                    if (mvccVersion != null) {
068                            setMvccVersion(mvccVersion);
069                    }
070    
071                    Long organizationId = (Long)attributes.get("organizationId");
072    
073                    if (organizationId != null) {
074                            setOrganizationId(organizationId);
075                    }
076    
077                    Long groupId = (Long)attributes.get("groupId");
078    
079                    if (groupId != null) {
080                            setGroupId(groupId);
081                    }
082    
083                    Long roleId = (Long)attributes.get("roleId");
084    
085                    if (roleId != null) {
086                            setRoleId(roleId);
087                    }
088    
089                    Long companyId = (Long)attributes.get("companyId");
090    
091                    if (companyId != null) {
092                            setCompanyId(companyId);
093                    }
094            }
095    
096            @Override
097            public java.lang.Object clone() {
098                    return new OrgGroupRoleWrapper((OrgGroupRole)_orgGroupRole.clone());
099            }
100    
101            @Override
102            public int compareTo(com.liferay.portal.model.OrgGroupRole orgGroupRole) {
103                    return _orgGroupRole.compareTo(orgGroupRole);
104            }
105    
106            @Override
107            public boolean containsGroup(
108                    java.util.List<com.liferay.portal.model.Group> groups) {
109                    return _orgGroupRole.containsGroup(groups);
110            }
111    
112            @Override
113            public boolean containsOrganization(
114                    java.util.List<com.liferay.portal.model.Organization> organizations) {
115                    return _orgGroupRole.containsOrganization(organizations);
116            }
117    
118            /**
119            * Returns the company ID of this org group role.
120            *
121            * @return the company ID of this org group role
122            */
123            @Override
124            public long getCompanyId() {
125                    return _orgGroupRole.getCompanyId();
126            }
127    
128            @Override
129            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
130                    return _orgGroupRole.getExpandoBridge();
131            }
132    
133            /**
134            * Returns the group ID of this org group role.
135            *
136            * @return the group ID of this org group role
137            */
138            @Override
139            public long getGroupId() {
140                    return _orgGroupRole.getGroupId();
141            }
142    
143            /**
144            * Returns the mvcc version of this org group role.
145            *
146            * @return the mvcc version of this org group role
147            */
148            @Override
149            public long getMvccVersion() {
150                    return _orgGroupRole.getMvccVersion();
151            }
152    
153            /**
154            * Returns the organization ID of this org group role.
155            *
156            * @return the organization ID of this org group role
157            */
158            @Override
159            public long getOrganizationId() {
160                    return _orgGroupRole.getOrganizationId();
161            }
162    
163            /**
164            * Returns the primary key of this org group role.
165            *
166            * @return the primary key of this org group role
167            */
168            @Override
169            public com.liferay.portal.service.persistence.OrgGroupRolePK getPrimaryKey() {
170                    return _orgGroupRole.getPrimaryKey();
171            }
172    
173            @Override
174            public java.io.Serializable getPrimaryKeyObj() {
175                    return _orgGroupRole.getPrimaryKeyObj();
176            }
177    
178            /**
179            * Returns the role ID of this org group role.
180            *
181            * @return the role ID of this org group role
182            */
183            @Override
184            public long getRoleId() {
185                    return _orgGroupRole.getRoleId();
186            }
187    
188            @Override
189            public int hashCode() {
190                    return _orgGroupRole.hashCode();
191            }
192    
193            @Override
194            public boolean isCachedModel() {
195                    return _orgGroupRole.isCachedModel();
196            }
197    
198            @Override
199            public boolean isEscapedModel() {
200                    return _orgGroupRole.isEscapedModel();
201            }
202    
203            @Override
204            public boolean isNew() {
205                    return _orgGroupRole.isNew();
206            }
207    
208            @Override
209            public void setCachedModel(boolean cachedModel) {
210                    _orgGroupRole.setCachedModel(cachedModel);
211            }
212    
213            /**
214            * Sets the company ID of this org group role.
215            *
216            * @param companyId the company ID of this org group role
217            */
218            @Override
219            public void setCompanyId(long companyId) {
220                    _orgGroupRole.setCompanyId(companyId);
221            }
222    
223            @Override
224            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
225                    _orgGroupRole.setExpandoBridgeAttributes(baseModel);
226            }
227    
228            @Override
229            public void setExpandoBridgeAttributes(
230                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
231                    _orgGroupRole.setExpandoBridgeAttributes(expandoBridge);
232            }
233    
234            @Override
235            public void setExpandoBridgeAttributes(
236                    com.liferay.portal.service.ServiceContext serviceContext) {
237                    _orgGroupRole.setExpandoBridgeAttributes(serviceContext);
238            }
239    
240            /**
241            * Sets the group ID of this org group role.
242            *
243            * @param groupId the group ID of this org group role
244            */
245            @Override
246            public void setGroupId(long groupId) {
247                    _orgGroupRole.setGroupId(groupId);
248            }
249    
250            /**
251            * Sets the mvcc version of this org group role.
252            *
253            * @param mvccVersion the mvcc version of this org group role
254            */
255            @Override
256            public void setMvccVersion(long mvccVersion) {
257                    _orgGroupRole.setMvccVersion(mvccVersion);
258            }
259    
260            @Override
261            public void setNew(boolean n) {
262                    _orgGroupRole.setNew(n);
263            }
264    
265            /**
266            * Sets the organization ID of this org group role.
267            *
268            * @param organizationId the organization ID of this org group role
269            */
270            @Override
271            public void setOrganizationId(long organizationId) {
272                    _orgGroupRole.setOrganizationId(organizationId);
273            }
274    
275            /**
276            * Sets the primary key of this org group role.
277            *
278            * @param primaryKey the primary key of this org group role
279            */
280            @Override
281            public void setPrimaryKey(
282                    com.liferay.portal.service.persistence.OrgGroupRolePK primaryKey) {
283                    _orgGroupRole.setPrimaryKey(primaryKey);
284            }
285    
286            @Override
287            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
288                    _orgGroupRole.setPrimaryKeyObj(primaryKeyObj);
289            }
290    
291            /**
292            * Sets the role ID of this org group role.
293            *
294            * @param roleId the role ID of this org group role
295            */
296            @Override
297            public void setRoleId(long roleId) {
298                    _orgGroupRole.setRoleId(roleId);
299            }
300    
301            @Override
302            public CacheModel<com.liferay.portal.model.OrgGroupRole> toCacheModel() {
303                    return _orgGroupRole.toCacheModel();
304            }
305    
306            @Override
307            public com.liferay.portal.model.OrgGroupRole toEscapedModel() {
308                    return new OrgGroupRoleWrapper(_orgGroupRole.toEscapedModel());
309            }
310    
311            @Override
312            public java.lang.String toString() {
313                    return _orgGroupRole.toString();
314            }
315    
316            @Override
317            public com.liferay.portal.model.OrgGroupRole toUnescapedModel() {
318                    return new OrgGroupRoleWrapper(_orgGroupRole.toUnescapedModel());
319            }
320    
321            @Override
322            public java.lang.String toXmlString() {
323                    return _orgGroupRole.toXmlString();
324            }
325    
326            @Override
327            public boolean equals(Object obj) {
328                    if (this == obj) {
329                            return true;
330                    }
331    
332                    if (!(obj instanceof OrgGroupRoleWrapper)) {
333                            return false;
334                    }
335    
336                    OrgGroupRoleWrapper orgGroupRoleWrapper = (OrgGroupRoleWrapper)obj;
337    
338                    if (Validator.equals(_orgGroupRole, orgGroupRoleWrapper._orgGroupRole)) {
339                            return true;
340                    }
341    
342                    return false;
343            }
344    
345            @Override
346            public OrgGroupRole getWrappedModel() {
347                    return _orgGroupRole;
348            }
349    
350            @Override
351            public boolean isEntityCacheEnabled() {
352                    return _orgGroupRole.isEntityCacheEnabled();
353            }
354    
355            @Override
356            public boolean isFinderCacheEnabled() {
357                    return _orgGroupRole.isFinderCacheEnabled();
358            }
359    
360            @Override
361            public void resetOriginalValues() {
362                    _orgGroupRole.resetOriginalValues();
363            }
364    
365            private final OrgGroupRole _orgGroupRole;
366    }