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.kernel.model;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.expando.kernel.model.ExpandoBridge;
020    
021    import com.liferay.portal.kernel.service.ServiceContext;
022    import com.liferay.portal.kernel.util.Validator;
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(
108                    com.liferay.portal.kernel.model.OrgGroupRole orgGroupRole) {
109                    return _orgGroupRole.compareTo(orgGroupRole);
110            }
111    
112            @Override
113            public boolean containsGroup(
114                    java.util.List<com.liferay.portal.kernel.model.Group> groups) {
115                    return _orgGroupRole.containsGroup(groups);
116            }
117    
118            @Override
119            public boolean containsOrganization(
120                    java.util.List<com.liferay.portal.kernel.model.Organization> organizations) {
121                    return _orgGroupRole.containsOrganization(organizations);
122            }
123    
124            /**
125            * Returns the company ID of this org group role.
126            *
127            * @return the company ID of this org group role
128            */
129            @Override
130            public long getCompanyId() {
131                    return _orgGroupRole.getCompanyId();
132            }
133    
134            @Override
135            public ExpandoBridge getExpandoBridge() {
136                    return _orgGroupRole.getExpandoBridge();
137            }
138    
139            /**
140            * Returns the group ID of this org group role.
141            *
142            * @return the group ID of this org group role
143            */
144            @Override
145            public long getGroupId() {
146                    return _orgGroupRole.getGroupId();
147            }
148    
149            /**
150            * Returns the mvcc version of this org group role.
151            *
152            * @return the mvcc version of this org group role
153            */
154            @Override
155            public long getMvccVersion() {
156                    return _orgGroupRole.getMvccVersion();
157            }
158    
159            /**
160            * Returns the organization ID of this org group role.
161            *
162            * @return the organization ID of this org group role
163            */
164            @Override
165            public long getOrganizationId() {
166                    return _orgGroupRole.getOrganizationId();
167            }
168    
169            /**
170            * Returns the primary key of this org group role.
171            *
172            * @return the primary key of this org group role
173            */
174            @Override
175            public com.liferay.portal.kernel.service.persistence.OrgGroupRolePK getPrimaryKey() {
176                    return _orgGroupRole.getPrimaryKey();
177            }
178    
179            @Override
180            public Serializable getPrimaryKeyObj() {
181                    return _orgGroupRole.getPrimaryKeyObj();
182            }
183    
184            /**
185            * Returns the role ID of this org group role.
186            *
187            * @return the role ID of this org group role
188            */
189            @Override
190            public long getRoleId() {
191                    return _orgGroupRole.getRoleId();
192            }
193    
194            @Override
195            public int hashCode() {
196                    return _orgGroupRole.hashCode();
197            }
198    
199            @Override
200            public boolean isCachedModel() {
201                    return _orgGroupRole.isCachedModel();
202            }
203    
204            @Override
205            public boolean isEscapedModel() {
206                    return _orgGroupRole.isEscapedModel();
207            }
208    
209            @Override
210            public boolean isNew() {
211                    return _orgGroupRole.isNew();
212            }
213    
214            @Override
215            public void setCachedModel(boolean cachedModel) {
216                    _orgGroupRole.setCachedModel(cachedModel);
217            }
218    
219            /**
220            * Sets the company ID of this org group role.
221            *
222            * @param companyId the company ID of this org group role
223            */
224            @Override
225            public void setCompanyId(long companyId) {
226                    _orgGroupRole.setCompanyId(companyId);
227            }
228    
229            @Override
230            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
231                    _orgGroupRole.setExpandoBridgeAttributes(baseModel);
232            }
233    
234            @Override
235            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
236                    _orgGroupRole.setExpandoBridgeAttributes(expandoBridge);
237            }
238    
239            @Override
240            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
241                    _orgGroupRole.setExpandoBridgeAttributes(serviceContext);
242            }
243    
244            /**
245            * Sets the group ID of this org group role.
246            *
247            * @param groupId the group ID of this org group role
248            */
249            @Override
250            public void setGroupId(long groupId) {
251                    _orgGroupRole.setGroupId(groupId);
252            }
253    
254            /**
255            * Sets the mvcc version of this org group role.
256            *
257            * @param mvccVersion the mvcc version of this org group role
258            */
259            @Override
260            public void setMvccVersion(long mvccVersion) {
261                    _orgGroupRole.setMvccVersion(mvccVersion);
262            }
263    
264            @Override
265            public void setNew(boolean n) {
266                    _orgGroupRole.setNew(n);
267            }
268    
269            /**
270            * Sets the organization ID of this org group role.
271            *
272            * @param organizationId the organization ID of this org group role
273            */
274            @Override
275            public void setOrganizationId(long organizationId) {
276                    _orgGroupRole.setOrganizationId(organizationId);
277            }
278    
279            /**
280            * Sets the primary key of this org group role.
281            *
282            * @param primaryKey the primary key of this org group role
283            */
284            @Override
285            public void setPrimaryKey(
286                    com.liferay.portal.kernel.service.persistence.OrgGroupRolePK primaryKey) {
287                    _orgGroupRole.setPrimaryKey(primaryKey);
288            }
289    
290            @Override
291            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
292                    _orgGroupRole.setPrimaryKeyObj(primaryKeyObj);
293            }
294    
295            /**
296            * Sets the role ID of this org group role.
297            *
298            * @param roleId the role ID of this org group role
299            */
300            @Override
301            public void setRoleId(long roleId) {
302                    _orgGroupRole.setRoleId(roleId);
303            }
304    
305            @Override
306            public CacheModel<com.liferay.portal.kernel.model.OrgGroupRole> toCacheModel() {
307                    return _orgGroupRole.toCacheModel();
308            }
309    
310            @Override
311            public com.liferay.portal.kernel.model.OrgGroupRole toEscapedModel() {
312                    return new OrgGroupRoleWrapper(_orgGroupRole.toEscapedModel());
313            }
314    
315            @Override
316            public java.lang.String toString() {
317                    return _orgGroupRole.toString();
318            }
319    
320            @Override
321            public com.liferay.portal.kernel.model.OrgGroupRole toUnescapedModel() {
322                    return new OrgGroupRoleWrapper(_orgGroupRole.toUnescapedModel());
323            }
324    
325            @Override
326            public java.lang.String toXmlString() {
327                    return _orgGroupRole.toXmlString();
328            }
329    
330            @Override
331            public boolean equals(Object obj) {
332                    if (this == obj) {
333                            return true;
334                    }
335    
336                    if (!(obj instanceof OrgGroupRoleWrapper)) {
337                            return false;
338                    }
339    
340                    OrgGroupRoleWrapper orgGroupRoleWrapper = (OrgGroupRoleWrapper)obj;
341    
342                    if (Validator.equals(_orgGroupRole, orgGroupRoleWrapper._orgGroupRole)) {
343                            return true;
344                    }
345    
346                    return false;
347            }
348    
349            @Override
350            public OrgGroupRole getWrappedModel() {
351                    return _orgGroupRole;
352            }
353    
354            @Override
355            public boolean isEntityCacheEnabled() {
356                    return _orgGroupRole.isEntityCacheEnabled();
357            }
358    
359            @Override
360            public boolean isFinderCacheEnabled() {
361                    return _orgGroupRole.isFinderCacheEnabled();
362            }
363    
364            @Override
365            public void resetOriginalValues() {
366                    _orgGroupRole.resetOriginalValues();
367            }
368    
369            private final OrgGroupRole _orgGroupRole;
370    }