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 UserGroup}.
025     * </p>
026     *
027     * @author    Brian Wing Shun Chan
028     * @see       UserGroup
029     * @generated
030     */
031    public class UserGroupWrapper implements UserGroup, ModelWrapper<UserGroup> {
032            public UserGroupWrapper(UserGroup userGroup) {
033                    _userGroup = userGroup;
034            }
035    
036            public Class<?> getModelClass() {
037                    return UserGroup.class;
038            }
039    
040            public String getModelClassName() {
041                    return UserGroup.class.getName();
042            }
043    
044            public Map<String, Object> getModelAttributes() {
045                    Map<String, Object> attributes = new HashMap<String, Object>();
046    
047                    attributes.put("userGroupId", getUserGroupId());
048                    attributes.put("companyId", getCompanyId());
049                    attributes.put("parentUserGroupId", getParentUserGroupId());
050                    attributes.put("name", getName());
051                    attributes.put("description", getDescription());
052                    attributes.put("addedByLDAPImport", getAddedByLDAPImport());
053    
054                    return attributes;
055            }
056    
057            public void setModelAttributes(Map<String, Object> attributes) {
058                    Long userGroupId = (Long)attributes.get("userGroupId");
059    
060                    if (userGroupId != null) {
061                            setUserGroupId(userGroupId);
062                    }
063    
064                    Long companyId = (Long)attributes.get("companyId");
065    
066                    if (companyId != null) {
067                            setCompanyId(companyId);
068                    }
069    
070                    Long parentUserGroupId = (Long)attributes.get("parentUserGroupId");
071    
072                    if (parentUserGroupId != null) {
073                            setParentUserGroupId(parentUserGroupId);
074                    }
075    
076                    String name = (String)attributes.get("name");
077    
078                    if (name != null) {
079                            setName(name);
080                    }
081    
082                    String description = (String)attributes.get("description");
083    
084                    if (description != null) {
085                            setDescription(description);
086                    }
087    
088                    Boolean addedByLDAPImport = (Boolean)attributes.get("addedByLDAPImport");
089    
090                    if (addedByLDAPImport != null) {
091                            setAddedByLDAPImport(addedByLDAPImport);
092                    }
093            }
094    
095            /**
096            * Returns the primary key of this user group.
097            *
098            * @return the primary key of this user group
099            */
100            public long getPrimaryKey() {
101                    return _userGroup.getPrimaryKey();
102            }
103    
104            /**
105            * Sets the primary key of this user group.
106            *
107            * @param primaryKey the primary key of this user group
108            */
109            public void setPrimaryKey(long primaryKey) {
110                    _userGroup.setPrimaryKey(primaryKey);
111            }
112    
113            /**
114            * Returns the user group ID of this user group.
115            *
116            * @return the user group ID of this user group
117            */
118            public long getUserGroupId() {
119                    return _userGroup.getUserGroupId();
120            }
121    
122            /**
123            * Sets the user group ID of this user group.
124            *
125            * @param userGroupId the user group ID of this user group
126            */
127            public void setUserGroupId(long userGroupId) {
128                    _userGroup.setUserGroupId(userGroupId);
129            }
130    
131            /**
132            * Returns the company ID of this user group.
133            *
134            * @return the company ID of this user group
135            */
136            public long getCompanyId() {
137                    return _userGroup.getCompanyId();
138            }
139    
140            /**
141            * Sets the company ID of this user group.
142            *
143            * @param companyId the company ID of this user group
144            */
145            public void setCompanyId(long companyId) {
146                    _userGroup.setCompanyId(companyId);
147            }
148    
149            /**
150            * Returns the parent user group ID of this user group.
151            *
152            * @return the parent user group ID of this user group
153            */
154            public long getParentUserGroupId() {
155                    return _userGroup.getParentUserGroupId();
156            }
157    
158            /**
159            * Sets the parent user group ID of this user group.
160            *
161            * @param parentUserGroupId the parent user group ID of this user group
162            */
163            public void setParentUserGroupId(long parentUserGroupId) {
164                    _userGroup.setParentUserGroupId(parentUserGroupId);
165            }
166    
167            /**
168            * Returns the name of this user group.
169            *
170            * @return the name of this user group
171            */
172            public java.lang.String getName() {
173                    return _userGroup.getName();
174            }
175    
176            /**
177            * Sets the name of this user group.
178            *
179            * @param name the name of this user group
180            */
181            public void setName(java.lang.String name) {
182                    _userGroup.setName(name);
183            }
184    
185            /**
186            * Returns the description of this user group.
187            *
188            * @return the description of this user group
189            */
190            public java.lang.String getDescription() {
191                    return _userGroup.getDescription();
192            }
193    
194            /**
195            * Sets the description of this user group.
196            *
197            * @param description the description of this user group
198            */
199            public void setDescription(java.lang.String description) {
200                    _userGroup.setDescription(description);
201            }
202    
203            /**
204            * Returns the added by l d a p import of this user group.
205            *
206            * @return the added by l d a p import of this user group
207            */
208            public boolean getAddedByLDAPImport() {
209                    return _userGroup.getAddedByLDAPImport();
210            }
211    
212            /**
213            * Returns <code>true</code> if this user group is added by l d a p import.
214            *
215            * @return <code>true</code> if this user group is added by l d a p import; <code>false</code> otherwise
216            */
217            public boolean isAddedByLDAPImport() {
218                    return _userGroup.isAddedByLDAPImport();
219            }
220    
221            /**
222            * Sets whether this user group is added by l d a p import.
223            *
224            * @param addedByLDAPImport the added by l d a p import of this user group
225            */
226            public void setAddedByLDAPImport(boolean addedByLDAPImport) {
227                    _userGroup.setAddedByLDAPImport(addedByLDAPImport);
228            }
229    
230            public boolean isNew() {
231                    return _userGroup.isNew();
232            }
233    
234            public void setNew(boolean n) {
235                    _userGroup.setNew(n);
236            }
237    
238            public boolean isCachedModel() {
239                    return _userGroup.isCachedModel();
240            }
241    
242            public void setCachedModel(boolean cachedModel) {
243                    _userGroup.setCachedModel(cachedModel);
244            }
245    
246            public boolean isEscapedModel() {
247                    return _userGroup.isEscapedModel();
248            }
249    
250            public java.io.Serializable getPrimaryKeyObj() {
251                    return _userGroup.getPrimaryKeyObj();
252            }
253    
254            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
255                    _userGroup.setPrimaryKeyObj(primaryKeyObj);
256            }
257    
258            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
259                    return _userGroup.getExpandoBridge();
260            }
261    
262            public void setExpandoBridgeAttributes(
263                    com.liferay.portal.service.ServiceContext serviceContext) {
264                    _userGroup.setExpandoBridgeAttributes(serviceContext);
265            }
266    
267            @Override
268            public java.lang.Object clone() {
269                    return new UserGroupWrapper((UserGroup)_userGroup.clone());
270            }
271    
272            public int compareTo(com.liferay.portal.model.UserGroup userGroup) {
273                    return _userGroup.compareTo(userGroup);
274            }
275    
276            @Override
277            public int hashCode() {
278                    return _userGroup.hashCode();
279            }
280    
281            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.UserGroup> toCacheModel() {
282                    return _userGroup.toCacheModel();
283            }
284    
285            public com.liferay.portal.model.UserGroup toEscapedModel() {
286                    return new UserGroupWrapper(_userGroup.toEscapedModel());
287            }
288    
289            public com.liferay.portal.model.UserGroup toUnescapedModel() {
290                    return new UserGroupWrapper(_userGroup.toUnescapedModel());
291            }
292    
293            @Override
294            public java.lang.String toString() {
295                    return _userGroup.toString();
296            }
297    
298            public java.lang.String toXmlString() {
299                    return _userGroup.toXmlString();
300            }
301    
302            public void persist()
303                    throws com.liferay.portal.kernel.exception.SystemException {
304                    _userGroup.persist();
305            }
306    
307            public com.liferay.portal.model.Group getGroup()
308                    throws com.liferay.portal.kernel.exception.PortalException,
309                            com.liferay.portal.kernel.exception.SystemException {
310                    return _userGroup.getGroup();
311            }
312    
313            public int getPrivateLayoutsPageCount()
314                    throws com.liferay.portal.kernel.exception.PortalException,
315                            com.liferay.portal.kernel.exception.SystemException {
316                    return _userGroup.getPrivateLayoutsPageCount();
317            }
318    
319            public int getPublicLayoutsPageCount()
320                    throws com.liferay.portal.kernel.exception.PortalException,
321                            com.liferay.portal.kernel.exception.SystemException {
322                    return _userGroup.getPublicLayoutsPageCount();
323            }
324    
325            public boolean hasPrivateLayouts()
326                    throws com.liferay.portal.kernel.exception.PortalException,
327                            com.liferay.portal.kernel.exception.SystemException {
328                    return _userGroup.hasPrivateLayouts();
329            }
330    
331            public boolean hasPublicLayouts()
332                    throws com.liferay.portal.kernel.exception.PortalException,
333                            com.liferay.portal.kernel.exception.SystemException {
334                    return _userGroup.hasPublicLayouts();
335            }
336    
337            @Override
338            public boolean equals(Object obj) {
339                    if (this == obj) {
340                            return true;
341                    }
342    
343                    if (!(obj instanceof UserGroupWrapper)) {
344                            return false;
345                    }
346    
347                    UserGroupWrapper userGroupWrapper = (UserGroupWrapper)obj;
348    
349                    if (Validator.equals(_userGroup, userGroupWrapper._userGroup)) {
350                            return true;
351                    }
352    
353                    return false;
354            }
355    
356            /**
357             * @deprecated Renamed to {@link #getWrappedModel}
358             */
359            public UserGroup getWrappedUserGroup() {
360                    return _userGroup;
361            }
362    
363            public UserGroup getWrappedModel() {
364                    return _userGroup;
365            }
366    
367            public void resetOriginalValues() {
368                    _userGroup.resetOriginalValues();
369            }
370    
371            private UserGroup _userGroup;
372    }