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.lar.StagedModelType;
018    import com.liferay.portal.kernel.util.Validator;
019    
020    import java.util.Date;
021    import java.util.HashMap;
022    import java.util.Map;
023    
024    /**
025     * <p>
026     * This class is a wrapper for {@link UserGroup}.
027     * </p>
028     *
029     * @author Brian Wing Shun Chan
030     * @see UserGroup
031     * @generated
032     */
033    public class UserGroupWrapper implements UserGroup, ModelWrapper<UserGroup> {
034            public UserGroupWrapper(UserGroup userGroup) {
035                    _userGroup = userGroup;
036            }
037    
038            @Override
039            public Class<?> getModelClass() {
040                    return UserGroup.class;
041            }
042    
043            @Override
044            public String getModelClassName() {
045                    return UserGroup.class.getName();
046            }
047    
048            @Override
049            public Map<String, Object> getModelAttributes() {
050                    Map<String, Object> attributes = new HashMap<String, Object>();
051    
052                    attributes.put("uuid", getUuid());
053                    attributes.put("userGroupId", getUserGroupId());
054                    attributes.put("companyId", getCompanyId());
055                    attributes.put("userId", getUserId());
056                    attributes.put("userName", getUserName());
057                    attributes.put("createDate", getCreateDate());
058                    attributes.put("modifiedDate", getModifiedDate());
059                    attributes.put("parentUserGroupId", getParentUserGroupId());
060                    attributes.put("name", getName());
061                    attributes.put("description", getDescription());
062                    attributes.put("addedByLDAPImport", getAddedByLDAPImport());
063    
064                    return attributes;
065            }
066    
067            @Override
068            public void setModelAttributes(Map<String, Object> attributes) {
069                    String uuid = (String)attributes.get("uuid");
070    
071                    if (uuid != null) {
072                            setUuid(uuid);
073                    }
074    
075                    Long userGroupId = (Long)attributes.get("userGroupId");
076    
077                    if (userGroupId != null) {
078                            setUserGroupId(userGroupId);
079                    }
080    
081                    Long companyId = (Long)attributes.get("companyId");
082    
083                    if (companyId != null) {
084                            setCompanyId(companyId);
085                    }
086    
087                    Long userId = (Long)attributes.get("userId");
088    
089                    if (userId != null) {
090                            setUserId(userId);
091                    }
092    
093                    String userName = (String)attributes.get("userName");
094    
095                    if (userName != null) {
096                            setUserName(userName);
097                    }
098    
099                    Date createDate = (Date)attributes.get("createDate");
100    
101                    if (createDate != null) {
102                            setCreateDate(createDate);
103                    }
104    
105                    Date modifiedDate = (Date)attributes.get("modifiedDate");
106    
107                    if (modifiedDate != null) {
108                            setModifiedDate(modifiedDate);
109                    }
110    
111                    Long parentUserGroupId = (Long)attributes.get("parentUserGroupId");
112    
113                    if (parentUserGroupId != null) {
114                            setParentUserGroupId(parentUserGroupId);
115                    }
116    
117                    String name = (String)attributes.get("name");
118    
119                    if (name != null) {
120                            setName(name);
121                    }
122    
123                    String description = (String)attributes.get("description");
124    
125                    if (description != null) {
126                            setDescription(description);
127                    }
128    
129                    Boolean addedByLDAPImport = (Boolean)attributes.get("addedByLDAPImport");
130    
131                    if (addedByLDAPImport != null) {
132                            setAddedByLDAPImport(addedByLDAPImport);
133                    }
134            }
135    
136            /**
137            * Returns the primary key of this user group.
138            *
139            * @return the primary key of this user group
140            */
141            @Override
142            public long getPrimaryKey() {
143                    return _userGroup.getPrimaryKey();
144            }
145    
146            /**
147            * Sets the primary key of this user group.
148            *
149            * @param primaryKey the primary key of this user group
150            */
151            @Override
152            public void setPrimaryKey(long primaryKey) {
153                    _userGroup.setPrimaryKey(primaryKey);
154            }
155    
156            /**
157            * Returns the uuid of this user group.
158            *
159            * @return the uuid of this user group
160            */
161            @Override
162            public java.lang.String getUuid() {
163                    return _userGroup.getUuid();
164            }
165    
166            /**
167            * Sets the uuid of this user group.
168            *
169            * @param uuid the uuid of this user group
170            */
171            @Override
172            public void setUuid(java.lang.String uuid) {
173                    _userGroup.setUuid(uuid);
174            }
175    
176            /**
177            * Returns the user group ID of this user group.
178            *
179            * @return the user group ID of this user group
180            */
181            @Override
182            public long getUserGroupId() {
183                    return _userGroup.getUserGroupId();
184            }
185    
186            /**
187            * Sets the user group ID of this user group.
188            *
189            * @param userGroupId the user group ID of this user group
190            */
191            @Override
192            public void setUserGroupId(long userGroupId) {
193                    _userGroup.setUserGroupId(userGroupId);
194            }
195    
196            /**
197            * Returns the company ID of this user group.
198            *
199            * @return the company ID of this user group
200            */
201            @Override
202            public long getCompanyId() {
203                    return _userGroup.getCompanyId();
204            }
205    
206            /**
207            * Sets the company ID of this user group.
208            *
209            * @param companyId the company ID of this user group
210            */
211            @Override
212            public void setCompanyId(long companyId) {
213                    _userGroup.setCompanyId(companyId);
214            }
215    
216            /**
217            * Returns the user ID of this user group.
218            *
219            * @return the user ID of this user group
220            */
221            @Override
222            public long getUserId() {
223                    return _userGroup.getUserId();
224            }
225    
226            /**
227            * Sets the user ID of this user group.
228            *
229            * @param userId the user ID of this user group
230            */
231            @Override
232            public void setUserId(long userId) {
233                    _userGroup.setUserId(userId);
234            }
235    
236            /**
237            * Returns the user uuid of this user group.
238            *
239            * @return the user uuid of this user group
240            * @throws SystemException if a system exception occurred
241            */
242            @Override
243            public java.lang.String getUserUuid()
244                    throws com.liferay.portal.kernel.exception.SystemException {
245                    return _userGroup.getUserUuid();
246            }
247    
248            /**
249            * Sets the user uuid of this user group.
250            *
251            * @param userUuid the user uuid of this user group
252            */
253            @Override
254            public void setUserUuid(java.lang.String userUuid) {
255                    _userGroup.setUserUuid(userUuid);
256            }
257    
258            /**
259            * Returns the user name of this user group.
260            *
261            * @return the user name of this user group
262            */
263            @Override
264            public java.lang.String getUserName() {
265                    return _userGroup.getUserName();
266            }
267    
268            /**
269            * Sets the user name of this user group.
270            *
271            * @param userName the user name of this user group
272            */
273            @Override
274            public void setUserName(java.lang.String userName) {
275                    _userGroup.setUserName(userName);
276            }
277    
278            /**
279            * Returns the create date of this user group.
280            *
281            * @return the create date of this user group
282            */
283            @Override
284            public java.util.Date getCreateDate() {
285                    return _userGroup.getCreateDate();
286            }
287    
288            /**
289            * Sets the create date of this user group.
290            *
291            * @param createDate the create date of this user group
292            */
293            @Override
294            public void setCreateDate(java.util.Date createDate) {
295                    _userGroup.setCreateDate(createDate);
296            }
297    
298            /**
299            * Returns the modified date of this user group.
300            *
301            * @return the modified date of this user group
302            */
303            @Override
304            public java.util.Date getModifiedDate() {
305                    return _userGroup.getModifiedDate();
306            }
307    
308            /**
309            * Sets the modified date of this user group.
310            *
311            * @param modifiedDate the modified date of this user group
312            */
313            @Override
314            public void setModifiedDate(java.util.Date modifiedDate) {
315                    _userGroup.setModifiedDate(modifiedDate);
316            }
317    
318            /**
319            * Returns the parent user group ID of this user group.
320            *
321            * @return the parent user group ID of this user group
322            */
323            @Override
324            public long getParentUserGroupId() {
325                    return _userGroup.getParentUserGroupId();
326            }
327    
328            /**
329            * Sets the parent user group ID of this user group.
330            *
331            * @param parentUserGroupId the parent user group ID of this user group
332            */
333            @Override
334            public void setParentUserGroupId(long parentUserGroupId) {
335                    _userGroup.setParentUserGroupId(parentUserGroupId);
336            }
337    
338            /**
339            * Returns the name of this user group.
340            *
341            * @return the name of this user group
342            */
343            @Override
344            public java.lang.String getName() {
345                    return _userGroup.getName();
346            }
347    
348            /**
349            * Sets the name of this user group.
350            *
351            * @param name the name of this user group
352            */
353            @Override
354            public void setName(java.lang.String name) {
355                    _userGroup.setName(name);
356            }
357    
358            /**
359            * Returns the description of this user group.
360            *
361            * @return the description of this user group
362            */
363            @Override
364            public java.lang.String getDescription() {
365                    return _userGroup.getDescription();
366            }
367    
368            /**
369            * Sets the description of this user group.
370            *
371            * @param description the description of this user group
372            */
373            @Override
374            public void setDescription(java.lang.String description) {
375                    _userGroup.setDescription(description);
376            }
377    
378            /**
379            * Returns the added by l d a p import of this user group.
380            *
381            * @return the added by l d a p import of this user group
382            */
383            @Override
384            public boolean getAddedByLDAPImport() {
385                    return _userGroup.getAddedByLDAPImport();
386            }
387    
388            /**
389            * Returns <code>true</code> if this user group is added by l d a p import.
390            *
391            * @return <code>true</code> if this user group is added by l d a p import; <code>false</code> otherwise
392            */
393            @Override
394            public boolean isAddedByLDAPImport() {
395                    return _userGroup.isAddedByLDAPImport();
396            }
397    
398            /**
399            * Sets whether this user group is added by l d a p import.
400            *
401            * @param addedByLDAPImport the added by l d a p import of this user group
402            */
403            @Override
404            public void setAddedByLDAPImport(boolean addedByLDAPImport) {
405                    _userGroup.setAddedByLDAPImport(addedByLDAPImport);
406            }
407    
408            @Override
409            public boolean isNew() {
410                    return _userGroup.isNew();
411            }
412    
413            @Override
414            public void setNew(boolean n) {
415                    _userGroup.setNew(n);
416            }
417    
418            @Override
419            public boolean isCachedModel() {
420                    return _userGroup.isCachedModel();
421            }
422    
423            @Override
424            public void setCachedModel(boolean cachedModel) {
425                    _userGroup.setCachedModel(cachedModel);
426            }
427    
428            @Override
429            public boolean isEscapedModel() {
430                    return _userGroup.isEscapedModel();
431            }
432    
433            @Override
434            public java.io.Serializable getPrimaryKeyObj() {
435                    return _userGroup.getPrimaryKeyObj();
436            }
437    
438            @Override
439            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
440                    _userGroup.setPrimaryKeyObj(primaryKeyObj);
441            }
442    
443            @Override
444            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
445                    return _userGroup.getExpandoBridge();
446            }
447    
448            @Override
449            public void setExpandoBridgeAttributes(
450                    com.liferay.portal.model.BaseModel<?> baseModel) {
451                    _userGroup.setExpandoBridgeAttributes(baseModel);
452            }
453    
454            @Override
455            public void setExpandoBridgeAttributes(
456                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
457                    _userGroup.setExpandoBridgeAttributes(expandoBridge);
458            }
459    
460            @Override
461            public void setExpandoBridgeAttributes(
462                    com.liferay.portal.service.ServiceContext serviceContext) {
463                    _userGroup.setExpandoBridgeAttributes(serviceContext);
464            }
465    
466            @Override
467            public java.lang.Object clone() {
468                    return new UserGroupWrapper((UserGroup)_userGroup.clone());
469            }
470    
471            @Override
472            public int compareTo(com.liferay.portal.model.UserGroup userGroup) {
473                    return _userGroup.compareTo(userGroup);
474            }
475    
476            @Override
477            public int hashCode() {
478                    return _userGroup.hashCode();
479            }
480    
481            @Override
482            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.UserGroup> toCacheModel() {
483                    return _userGroup.toCacheModel();
484            }
485    
486            @Override
487            public com.liferay.portal.model.UserGroup toEscapedModel() {
488                    return new UserGroupWrapper(_userGroup.toEscapedModel());
489            }
490    
491            @Override
492            public com.liferay.portal.model.UserGroup toUnescapedModel() {
493                    return new UserGroupWrapper(_userGroup.toUnescapedModel());
494            }
495    
496            @Override
497            public java.lang.String toString() {
498                    return _userGroup.toString();
499            }
500    
501            @Override
502            public java.lang.String toXmlString() {
503                    return _userGroup.toXmlString();
504            }
505    
506            @Override
507            public void persist()
508                    throws com.liferay.portal.kernel.exception.SystemException {
509                    _userGroup.persist();
510            }
511    
512            @Override
513            public com.liferay.portal.model.Group getGroup()
514                    throws com.liferay.portal.kernel.exception.PortalException,
515                            com.liferay.portal.kernel.exception.SystemException {
516                    return _userGroup.getGroup();
517            }
518    
519            @Override
520            public long getGroupId()
521                    throws com.liferay.portal.kernel.exception.PortalException,
522                            com.liferay.portal.kernel.exception.SystemException {
523                    return _userGroup.getGroupId();
524            }
525    
526            @Override
527            public int getPrivateLayoutsPageCount()
528                    throws com.liferay.portal.kernel.exception.PortalException,
529                            com.liferay.portal.kernel.exception.SystemException {
530                    return _userGroup.getPrivateLayoutsPageCount();
531            }
532    
533            @Override
534            public int getPublicLayoutsPageCount()
535                    throws com.liferay.portal.kernel.exception.PortalException,
536                            com.liferay.portal.kernel.exception.SystemException {
537                    return _userGroup.getPublicLayoutsPageCount();
538            }
539    
540            @Override
541            public boolean hasPrivateLayouts()
542                    throws com.liferay.portal.kernel.exception.PortalException,
543                            com.liferay.portal.kernel.exception.SystemException {
544                    return _userGroup.hasPrivateLayouts();
545            }
546    
547            @Override
548            public boolean hasPublicLayouts()
549                    throws com.liferay.portal.kernel.exception.PortalException,
550                            com.liferay.portal.kernel.exception.SystemException {
551                    return _userGroup.hasPublicLayouts();
552            }
553    
554            @Override
555            public boolean equals(Object obj) {
556                    if (this == obj) {
557                            return true;
558                    }
559    
560                    if (!(obj instanceof UserGroupWrapper)) {
561                            return false;
562                    }
563    
564                    UserGroupWrapper userGroupWrapper = (UserGroupWrapper)obj;
565    
566                    if (Validator.equals(_userGroup, userGroupWrapper._userGroup)) {
567                            return true;
568                    }
569    
570                    return false;
571            }
572    
573            @Override
574            public StagedModelType getStagedModelType() {
575                    return _userGroup.getStagedModelType();
576            }
577    
578            /**
579             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
580             */
581            public UserGroup getWrappedUserGroup() {
582                    return _userGroup;
583            }
584    
585            @Override
586            public UserGroup getWrappedModel() {
587                    return _userGroup;
588            }
589    
590            @Override
591            public void resetOriginalValues() {
592                    _userGroup.resetOriginalValues();
593            }
594    
595            private UserGroup _userGroup;
596    }