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