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 com.liferay.portal.kernel.util.Validator;
018    
019    import java.util.HashMap;
020    import java.util.Map;
021    
022    /**
023     * <p>
024     * This class is a wrapper for {@link OrgGroupPermission}.
025     * </p>
026     *
027     * @author    Brian Wing Shun Chan
028     * @see       OrgGroupPermission
029     * @generated
030     */
031    public class OrgGroupPermissionWrapper implements OrgGroupPermission,
032            ModelWrapper<OrgGroupPermission> {
033            public OrgGroupPermissionWrapper(OrgGroupPermission orgGroupPermission) {
034                    _orgGroupPermission = orgGroupPermission;
035            }
036    
037            public Class<?> getModelClass() {
038                    return OrgGroupPermission.class;
039            }
040    
041            public String getModelClassName() {
042                    return OrgGroupPermission.class.getName();
043            }
044    
045            public Map<String, Object> getModelAttributes() {
046                    Map<String, Object> attributes = new HashMap<String, Object>();
047    
048                    attributes.put("organizationId", getOrganizationId());
049                    attributes.put("groupId", getGroupId());
050                    attributes.put("permissionId", getPermissionId());
051    
052                    return attributes;
053            }
054    
055            public void setModelAttributes(Map<String, Object> attributes) {
056                    Long organizationId = (Long)attributes.get("organizationId");
057    
058                    if (organizationId != null) {
059                            setOrganizationId(organizationId);
060                    }
061    
062                    Long groupId = (Long)attributes.get("groupId");
063    
064                    if (groupId != null) {
065                            setGroupId(groupId);
066                    }
067    
068                    Long permissionId = (Long)attributes.get("permissionId");
069    
070                    if (permissionId != null) {
071                            setPermissionId(permissionId);
072                    }
073            }
074    
075            /**
076            * Returns the primary key of this org group permission.
077            *
078            * @return the primary key of this org group permission
079            */
080            public com.liferay.portal.service.persistence.OrgGroupPermissionPK getPrimaryKey() {
081                    return _orgGroupPermission.getPrimaryKey();
082            }
083    
084            /**
085            * Sets the primary key of this org group permission.
086            *
087            * @param primaryKey the primary key of this org group permission
088            */
089            public void setPrimaryKey(
090                    com.liferay.portal.service.persistence.OrgGroupPermissionPK primaryKey) {
091                    _orgGroupPermission.setPrimaryKey(primaryKey);
092            }
093    
094            /**
095            * Returns the organization ID of this org group permission.
096            *
097            * @return the organization ID of this org group permission
098            */
099            public long getOrganizationId() {
100                    return _orgGroupPermission.getOrganizationId();
101            }
102    
103            /**
104            * Sets the organization ID of this org group permission.
105            *
106            * @param organizationId the organization ID of this org group permission
107            */
108            public void setOrganizationId(long organizationId) {
109                    _orgGroupPermission.setOrganizationId(organizationId);
110            }
111    
112            /**
113            * Returns the group ID of this org group permission.
114            *
115            * @return the group ID of this org group permission
116            */
117            public long getGroupId() {
118                    return _orgGroupPermission.getGroupId();
119            }
120    
121            /**
122            * Sets the group ID of this org group permission.
123            *
124            * @param groupId the group ID of this org group permission
125            */
126            public void setGroupId(long groupId) {
127                    _orgGroupPermission.setGroupId(groupId);
128            }
129    
130            /**
131            * Returns the permission ID of this org group permission.
132            *
133            * @return the permission ID of this org group permission
134            */
135            public long getPermissionId() {
136                    return _orgGroupPermission.getPermissionId();
137            }
138    
139            /**
140            * Sets the permission ID of this org group permission.
141            *
142            * @param permissionId the permission ID of this org group permission
143            */
144            public void setPermissionId(long permissionId) {
145                    _orgGroupPermission.setPermissionId(permissionId);
146            }
147    
148            public boolean isNew() {
149                    return _orgGroupPermission.isNew();
150            }
151    
152            public void setNew(boolean n) {
153                    _orgGroupPermission.setNew(n);
154            }
155    
156            public boolean isCachedModel() {
157                    return _orgGroupPermission.isCachedModel();
158            }
159    
160            public void setCachedModel(boolean cachedModel) {
161                    _orgGroupPermission.setCachedModel(cachedModel);
162            }
163    
164            public boolean isEscapedModel() {
165                    return _orgGroupPermission.isEscapedModel();
166            }
167    
168            public java.io.Serializable getPrimaryKeyObj() {
169                    return _orgGroupPermission.getPrimaryKeyObj();
170            }
171    
172            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
173                    _orgGroupPermission.setPrimaryKeyObj(primaryKeyObj);
174            }
175    
176            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
177                    return _orgGroupPermission.getExpandoBridge();
178            }
179    
180            public void setExpandoBridgeAttributes(
181                    com.liferay.portal.service.ServiceContext serviceContext) {
182                    _orgGroupPermission.setExpandoBridgeAttributes(serviceContext);
183            }
184    
185            @Override
186            public java.lang.Object clone() {
187                    return new OrgGroupPermissionWrapper((OrgGroupPermission)_orgGroupPermission.clone());
188            }
189    
190            public int compareTo(
191                    com.liferay.portal.model.OrgGroupPermission orgGroupPermission) {
192                    return _orgGroupPermission.compareTo(orgGroupPermission);
193            }
194    
195            @Override
196            public int hashCode() {
197                    return _orgGroupPermission.hashCode();
198            }
199    
200            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.OrgGroupPermission> toCacheModel() {
201                    return _orgGroupPermission.toCacheModel();
202            }
203    
204            public com.liferay.portal.model.OrgGroupPermission toEscapedModel() {
205                    return new OrgGroupPermissionWrapper(_orgGroupPermission.toEscapedModel());
206            }
207    
208            public com.liferay.portal.model.OrgGroupPermission toUnescapedModel() {
209                    return new OrgGroupPermissionWrapper(_orgGroupPermission.toUnescapedModel());
210            }
211    
212            @Override
213            public java.lang.String toString() {
214                    return _orgGroupPermission.toString();
215            }
216    
217            public java.lang.String toXmlString() {
218                    return _orgGroupPermission.toXmlString();
219            }
220    
221            public boolean containsGroup(
222                    java.util.List<com.liferay.portal.model.Group> groups) {
223                    return _orgGroupPermission.containsGroup(groups);
224            }
225    
226            public boolean containsOrganization(
227                    java.util.List<com.liferay.portal.model.Organization> organizations) {
228                    return _orgGroupPermission.containsOrganization(organizations);
229            }
230    
231            @Override
232            public boolean equals(Object obj) {
233                    if (this == obj) {
234                            return true;
235                    }
236    
237                    if (!(obj instanceof OrgGroupPermissionWrapper)) {
238                            return false;
239                    }
240    
241                    OrgGroupPermissionWrapper orgGroupPermissionWrapper = (OrgGroupPermissionWrapper)obj;
242    
243                    if (Validator.equals(_orgGroupPermission,
244                                            orgGroupPermissionWrapper._orgGroupPermission)) {
245                            return true;
246                    }
247    
248                    return false;
249            }
250    
251            /**
252             * @deprecated Renamed to {@link #getWrappedModel}
253             */
254            public OrgGroupPermission getWrappedOrgGroupPermission() {
255                    return _orgGroupPermission;
256            }
257    
258            public OrgGroupPermission getWrappedModel() {
259                    return _orgGroupPermission;
260            }
261    
262            public void resetOriginalValues() {
263                    _orgGroupPermission.resetOriginalValues();
264            }
265    
266            private OrgGroupPermission _orgGroupPermission;
267    }