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