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