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