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 java.util.Date;
018    import java.util.HashMap;
019    import java.util.Map;
020    
021    /**
022     * <p>
023     * This class is a wrapper for {@link Role}.
024     * </p>
025     *
026     * @author    Brian Wing Shun Chan
027     * @see       Role
028     * @generated
029     */
030    public class RoleWrapper implements Role, ModelWrapper<Role> {
031            public RoleWrapper(Role role) {
032                    _role = role;
033            }
034    
035            public Class<?> getModelClass() {
036                    return Role.class;
037            }
038    
039            public String getModelClassName() {
040                    return Role.class.getName();
041            }
042    
043            public Map<String, Object> getModelAttributes() {
044                    Map<String, Object> attributes = new HashMap<String, Object>();
045    
046                    attributes.put("uuid", getUuid());
047                    attributes.put("roleId", getRoleId());
048                    attributes.put("companyId", getCompanyId());
049                    attributes.put("userId", getUserId());
050                    attributes.put("userName", getUserName());
051                    attributes.put("createDate", getCreateDate());
052                    attributes.put("modifiedDate", getModifiedDate());
053                    attributes.put("classNameId", getClassNameId());
054                    attributes.put("classPK", getClassPK());
055                    attributes.put("name", getName());
056                    attributes.put("title", getTitle());
057                    attributes.put("description", getDescription());
058                    attributes.put("type", getType());
059                    attributes.put("subtype", getSubtype());
060    
061                    return attributes;
062            }
063    
064            public void setModelAttributes(Map<String, Object> attributes) {
065                    String uuid = (String)attributes.get("uuid");
066    
067                    if (uuid != null) {
068                            setUuid(uuid);
069                    }
070    
071                    Long roleId = (Long)attributes.get("roleId");
072    
073                    if (roleId != null) {
074                            setRoleId(roleId);
075                    }
076    
077                    Long companyId = (Long)attributes.get("companyId");
078    
079                    if (companyId != null) {
080                            setCompanyId(companyId);
081                    }
082    
083                    Long userId = (Long)attributes.get("userId");
084    
085                    if (userId != null) {
086                            setUserId(userId);
087                    }
088    
089                    String userName = (String)attributes.get("userName");
090    
091                    if (userName != null) {
092                            setUserName(userName);
093                    }
094    
095                    Date createDate = (Date)attributes.get("createDate");
096    
097                    if (createDate != null) {
098                            setCreateDate(createDate);
099                    }
100    
101                    Date modifiedDate = (Date)attributes.get("modifiedDate");
102    
103                    if (modifiedDate != null) {
104                            setModifiedDate(modifiedDate);
105                    }
106    
107                    Long classNameId = (Long)attributes.get("classNameId");
108    
109                    if (classNameId != null) {
110                            setClassNameId(classNameId);
111                    }
112    
113                    Long classPK = (Long)attributes.get("classPK");
114    
115                    if (classPK != null) {
116                            setClassPK(classPK);
117                    }
118    
119                    String name = (String)attributes.get("name");
120    
121                    if (name != null) {
122                            setName(name);
123                    }
124    
125                    String title = (String)attributes.get("title");
126    
127                    if (title != null) {
128                            setTitle(title);
129                    }
130    
131                    String description = (String)attributes.get("description");
132    
133                    if (description != null) {
134                            setDescription(description);
135                    }
136    
137                    Integer type = (Integer)attributes.get("type");
138    
139                    if (type != null) {
140                            setType(type);
141                    }
142    
143                    String subtype = (String)attributes.get("subtype");
144    
145                    if (subtype != null) {
146                            setSubtype(subtype);
147                    }
148            }
149    
150            /**
151            * Returns the primary key of this role.
152            *
153            * @return the primary key of this role
154            */
155            public long getPrimaryKey() {
156                    return _role.getPrimaryKey();
157            }
158    
159            /**
160            * Sets the primary key of this role.
161            *
162            * @param primaryKey the primary key of this role
163            */
164            public void setPrimaryKey(long primaryKey) {
165                    _role.setPrimaryKey(primaryKey);
166            }
167    
168            /**
169            * Returns the uuid of this role.
170            *
171            * @return the uuid of this role
172            */
173            public java.lang.String getUuid() {
174                    return _role.getUuid();
175            }
176    
177            /**
178            * Sets the uuid of this role.
179            *
180            * @param uuid the uuid of this role
181            */
182            public void setUuid(java.lang.String uuid) {
183                    _role.setUuid(uuid);
184            }
185    
186            /**
187            * Returns the role ID of this role.
188            *
189            * @return the role ID of this role
190            */
191            public long getRoleId() {
192                    return _role.getRoleId();
193            }
194    
195            /**
196            * Sets the role ID of this role.
197            *
198            * @param roleId the role ID of this role
199            */
200            public void setRoleId(long roleId) {
201                    _role.setRoleId(roleId);
202            }
203    
204            /**
205            * Returns the company ID of this role.
206            *
207            * @return the company ID of this role
208            */
209            public long getCompanyId() {
210                    return _role.getCompanyId();
211            }
212    
213            /**
214            * Sets the company ID of this role.
215            *
216            * @param companyId the company ID of this role
217            */
218            public void setCompanyId(long companyId) {
219                    _role.setCompanyId(companyId);
220            }
221    
222            /**
223            * Returns the user ID of this role.
224            *
225            * @return the user ID of this role
226            */
227            public long getUserId() {
228                    return _role.getUserId();
229            }
230    
231            /**
232            * Sets the user ID of this role.
233            *
234            * @param userId the user ID of this role
235            */
236            public void setUserId(long userId) {
237                    _role.setUserId(userId);
238            }
239    
240            /**
241            * Returns the user uuid of this role.
242            *
243            * @return the user uuid of this role
244            * @throws SystemException if a system exception occurred
245            */
246            public java.lang.String getUserUuid()
247                    throws com.liferay.portal.kernel.exception.SystemException {
248                    return _role.getUserUuid();
249            }
250    
251            /**
252            * Sets the user uuid of this role.
253            *
254            * @param userUuid the user uuid of this role
255            */
256            public void setUserUuid(java.lang.String userUuid) {
257                    _role.setUserUuid(userUuid);
258            }
259    
260            /**
261            * Returns the user name of this role.
262            *
263            * @return the user name of this role
264            */
265            public java.lang.String getUserName() {
266                    return _role.getUserName();
267            }
268    
269            /**
270            * Sets the user name of this role.
271            *
272            * @param userName the user name of this role
273            */
274            public void setUserName(java.lang.String userName) {
275                    _role.setUserName(userName);
276            }
277    
278            /**
279            * Returns the create date of this role.
280            *
281            * @return the create date of this role
282            */
283            public java.util.Date getCreateDate() {
284                    return _role.getCreateDate();
285            }
286    
287            /**
288            * Sets the create date of this role.
289            *
290            * @param createDate the create date of this role
291            */
292            public void setCreateDate(java.util.Date createDate) {
293                    _role.setCreateDate(createDate);
294            }
295    
296            /**
297            * Returns the modified date of this role.
298            *
299            * @return the modified date of this role
300            */
301            public java.util.Date getModifiedDate() {
302                    return _role.getModifiedDate();
303            }
304    
305            /**
306            * Sets the modified date of this role.
307            *
308            * @param modifiedDate the modified date of this role
309            */
310            public void setModifiedDate(java.util.Date modifiedDate) {
311                    _role.setModifiedDate(modifiedDate);
312            }
313    
314            /**
315            * Returns the fully qualified class name of this role.
316            *
317            * @return the fully qualified class name of this role
318            */
319            public java.lang.String getClassName() {
320                    return _role.getClassName();
321            }
322    
323            public void setClassName(java.lang.String className) {
324                    _role.setClassName(className);
325            }
326    
327            /**
328            * Returns the class name ID of this role.
329            *
330            * @return the class name ID of this role
331            */
332            public long getClassNameId() {
333                    return _role.getClassNameId();
334            }
335    
336            /**
337            * Sets the class name ID of this role.
338            *
339            * @param classNameId the class name ID of this role
340            */
341            public void setClassNameId(long classNameId) {
342                    _role.setClassNameId(classNameId);
343            }
344    
345            /**
346            * Returns the class p k of this role.
347            *
348            * @return the class p k of this role
349            */
350            public long getClassPK() {
351                    return _role.getClassPK();
352            }
353    
354            /**
355            * Sets the class p k of this role.
356            *
357            * @param classPK the class p k of this role
358            */
359            public void setClassPK(long classPK) {
360                    _role.setClassPK(classPK);
361            }
362    
363            /**
364            * Returns the name of this role.
365            *
366            * @return the name of this role
367            */
368            public java.lang.String getName() {
369                    return _role.getName();
370            }
371    
372            /**
373            * Sets the name of this role.
374            *
375            * @param name the name of this role
376            */
377            public void setName(java.lang.String name) {
378                    _role.setName(name);
379            }
380    
381            /**
382            * Returns the title of this role.
383            *
384            * @return the title of this role
385            */
386            public java.lang.String getTitle() {
387                    return _role.getTitle();
388            }
389    
390            /**
391            * Returns the localized title of this role in the language. Uses the default language if no localization exists for the requested language.
392            *
393            * @param locale the locale of the language
394            * @return the localized title of this role
395            */
396            public java.lang.String getTitle(java.util.Locale locale) {
397                    return _role.getTitle(locale);
398            }
399    
400            /**
401            * Returns the localized title of this role in the language, optionally using the default language if no localization exists for the requested language.
402            *
403            * @param locale the local of the language
404            * @param useDefault whether to use the default language if no localization exists for the requested language
405            * @return the localized title of this role. If <code>useDefault</code> is <code>false</code> and no localization exists for the requested language, an empty string will be returned.
406            */
407            public java.lang.String getTitle(java.util.Locale locale, boolean useDefault) {
408                    return _role.getTitle(locale, useDefault);
409            }
410    
411            /**
412            * Returns the localized title of this role in the language. Uses the default language if no localization exists for the requested language.
413            *
414            * @param languageId the ID of the language
415            * @return the localized title of this role
416            */
417            public java.lang.String getTitle(java.lang.String languageId) {
418                    return _role.getTitle(languageId);
419            }
420    
421            /**
422            * Returns the localized title of this role in the language, optionally using the default language if no localization exists for the requested language.
423            *
424            * @param languageId the ID of the language
425            * @param useDefault whether to use the default language if no localization exists for the requested language
426            * @return the localized title of this role
427            */
428            public java.lang.String getTitle(java.lang.String languageId,
429                    boolean useDefault) {
430                    return _role.getTitle(languageId, useDefault);
431            }
432    
433            public java.lang.String getTitleCurrentLanguageId() {
434                    return _role.getTitleCurrentLanguageId();
435            }
436    
437            public java.lang.String getTitleCurrentValue() {
438                    return _role.getTitleCurrentValue();
439            }
440    
441            /**
442            * Returns a map of the locales and localized titles of this role.
443            *
444            * @return the locales and localized titles of this role
445            */
446            public java.util.Map<java.util.Locale, java.lang.String> getTitleMap() {
447                    return _role.getTitleMap();
448            }
449    
450            /**
451            * Sets the title of this role.
452            *
453            * @param title the title of this role
454            */
455            public void setTitle(java.lang.String title) {
456                    _role.setTitle(title);
457            }
458    
459            /**
460            * Sets the localized title of this role in the language.
461            *
462            * @param title the localized title of this role
463            * @param locale the locale of the language
464            */
465            public void setTitle(java.lang.String title, java.util.Locale locale) {
466                    _role.setTitle(title, locale);
467            }
468    
469            /**
470            * Sets the localized title of this role in the language, and sets the default locale.
471            *
472            * @param title the localized title of this role
473            * @param locale the locale of the language
474            * @param defaultLocale the default locale
475            */
476            public void setTitle(java.lang.String title, java.util.Locale locale,
477                    java.util.Locale defaultLocale) {
478                    _role.setTitle(title, locale, defaultLocale);
479            }
480    
481            public void setTitleCurrentLanguageId(java.lang.String languageId) {
482                    _role.setTitleCurrentLanguageId(languageId);
483            }
484    
485            /**
486            * Sets the localized titles of this role from the map of locales and localized titles.
487            *
488            * @param titleMap the locales and localized titles of this role
489            */
490            public void setTitleMap(
491                    java.util.Map<java.util.Locale, java.lang.String> titleMap) {
492                    _role.setTitleMap(titleMap);
493            }
494    
495            /**
496            * Sets the localized titles of this role from the map of locales and localized titles, and sets the default locale.
497            *
498            * @param titleMap the locales and localized titles of this role
499            * @param defaultLocale the default locale
500            */
501            public void setTitleMap(
502                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
503                    java.util.Locale defaultLocale) {
504                    _role.setTitleMap(titleMap, defaultLocale);
505            }
506    
507            /**
508            * Returns the description of this role.
509            *
510            * @return the description of this role
511            */
512            public java.lang.String getDescription() {
513                    return _role.getDescription();
514            }
515    
516            /**
517            * Returns the localized description of this role in the language. Uses the default language if no localization exists for the requested language.
518            *
519            * @param locale the locale of the language
520            * @return the localized description of this role
521            */
522            public java.lang.String getDescription(java.util.Locale locale) {
523                    return _role.getDescription(locale);
524            }
525    
526            /**
527            * Returns the localized description of this role in the language, optionally using the default language if no localization exists for the requested language.
528            *
529            * @param locale the local of the language
530            * @param useDefault whether to use the default language if no localization exists for the requested language
531            * @return the localized description of this role. If <code>useDefault</code> is <code>false</code> and no localization exists for the requested language, an empty string will be returned.
532            */
533            public java.lang.String getDescription(java.util.Locale locale,
534                    boolean useDefault) {
535                    return _role.getDescription(locale, useDefault);
536            }
537    
538            /**
539            * Returns the localized description of this role in the language. Uses the default language if no localization exists for the requested language.
540            *
541            * @param languageId the ID of the language
542            * @return the localized description of this role
543            */
544            public java.lang.String getDescription(java.lang.String languageId) {
545                    return _role.getDescription(languageId);
546            }
547    
548            /**
549            * Returns the localized description of this role in the language, optionally using the default language if no localization exists for the requested language.
550            *
551            * @param languageId the ID of the language
552            * @param useDefault whether to use the default language if no localization exists for the requested language
553            * @return the localized description of this role
554            */
555            public java.lang.String getDescription(java.lang.String languageId,
556                    boolean useDefault) {
557                    return _role.getDescription(languageId, useDefault);
558            }
559    
560            public java.lang.String getDescriptionCurrentLanguageId() {
561                    return _role.getDescriptionCurrentLanguageId();
562            }
563    
564            public java.lang.String getDescriptionCurrentValue() {
565                    return _role.getDescriptionCurrentValue();
566            }
567    
568            /**
569            * Returns a map of the locales and localized descriptions of this role.
570            *
571            * @return the locales and localized descriptions of this role
572            */
573            public java.util.Map<java.util.Locale, java.lang.String> getDescriptionMap() {
574                    return _role.getDescriptionMap();
575            }
576    
577            /**
578            * Sets the description of this role.
579            *
580            * @param description the description of this role
581            */
582            public void setDescription(java.lang.String description) {
583                    _role.setDescription(description);
584            }
585    
586            /**
587            * Sets the localized description of this role in the language.
588            *
589            * @param description the localized description of this role
590            * @param locale the locale of the language
591            */
592            public void setDescription(java.lang.String description,
593                    java.util.Locale locale) {
594                    _role.setDescription(description, locale);
595            }
596    
597            /**
598            * Sets the localized description of this role in the language, and sets the default locale.
599            *
600            * @param description the localized description of this role
601            * @param locale the locale of the language
602            * @param defaultLocale the default locale
603            */
604            public void setDescription(java.lang.String description,
605                    java.util.Locale locale, java.util.Locale defaultLocale) {
606                    _role.setDescription(description, locale, defaultLocale);
607            }
608    
609            public void setDescriptionCurrentLanguageId(java.lang.String languageId) {
610                    _role.setDescriptionCurrentLanguageId(languageId);
611            }
612    
613            /**
614            * Sets the localized descriptions of this role from the map of locales and localized descriptions.
615            *
616            * @param descriptionMap the locales and localized descriptions of this role
617            */
618            public void setDescriptionMap(
619                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap) {
620                    _role.setDescriptionMap(descriptionMap);
621            }
622    
623            /**
624            * Sets the localized descriptions of this role from the map of locales and localized descriptions, and sets the default locale.
625            *
626            * @param descriptionMap the locales and localized descriptions of this role
627            * @param defaultLocale the default locale
628            */
629            public void setDescriptionMap(
630                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
631                    java.util.Locale defaultLocale) {
632                    _role.setDescriptionMap(descriptionMap, defaultLocale);
633            }
634    
635            /**
636            * Returns the type of this role.
637            *
638            * @return the type of this role
639            */
640            public int getType() {
641                    return _role.getType();
642            }
643    
644            /**
645            * Sets the type of this role.
646            *
647            * @param type the type of this role
648            */
649            public void setType(int type) {
650                    _role.setType(type);
651            }
652    
653            /**
654            * Returns the subtype of this role.
655            *
656            * @return the subtype of this role
657            */
658            public java.lang.String getSubtype() {
659                    return _role.getSubtype();
660            }
661    
662            /**
663            * Sets the subtype of this role.
664            *
665            * @param subtype the subtype of this role
666            */
667            public void setSubtype(java.lang.String subtype) {
668                    _role.setSubtype(subtype);
669            }
670    
671            public boolean isNew() {
672                    return _role.isNew();
673            }
674    
675            public void setNew(boolean n) {
676                    _role.setNew(n);
677            }
678    
679            public boolean isCachedModel() {
680                    return _role.isCachedModel();
681            }
682    
683            public void setCachedModel(boolean cachedModel) {
684                    _role.setCachedModel(cachedModel);
685            }
686    
687            public boolean isEscapedModel() {
688                    return _role.isEscapedModel();
689            }
690    
691            public java.io.Serializable getPrimaryKeyObj() {
692                    return _role.getPrimaryKeyObj();
693            }
694    
695            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
696                    _role.setPrimaryKeyObj(primaryKeyObj);
697            }
698    
699            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
700                    return _role.getExpandoBridge();
701            }
702    
703            public void setExpandoBridgeAttributes(
704                    com.liferay.portal.model.BaseModel<?> baseModel) {
705                    _role.setExpandoBridgeAttributes(baseModel);
706            }
707    
708            public void setExpandoBridgeAttributes(
709                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
710                    _role.setExpandoBridgeAttributes(expandoBridge);
711            }
712    
713            public void setExpandoBridgeAttributes(
714                    com.liferay.portal.service.ServiceContext serviceContext) {
715                    _role.setExpandoBridgeAttributes(serviceContext);
716            }
717    
718            public void prepareLocalizedFieldsForImport(
719                    java.util.Locale defaultImportLocale)
720                    throws com.liferay.portal.LocaleException {
721                    _role.prepareLocalizedFieldsForImport(defaultImportLocale);
722            }
723    
724            @Override
725            public java.lang.Object clone() {
726                    return new RoleWrapper((Role)_role.clone());
727            }
728    
729            public int compareTo(com.liferay.portal.model.Role role) {
730                    return _role.compareTo(role);
731            }
732    
733            @Override
734            public int hashCode() {
735                    return _role.hashCode();
736            }
737    
738            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.Role> toCacheModel() {
739                    return _role.toCacheModel();
740            }
741    
742            public com.liferay.portal.model.Role toEscapedModel() {
743                    return new RoleWrapper(_role.toEscapedModel());
744            }
745    
746            public com.liferay.portal.model.Role toUnescapedModel() {
747                    return new RoleWrapper(_role.toUnescapedModel());
748            }
749    
750            @Override
751            public java.lang.String toString() {
752                    return _role.toString();
753            }
754    
755            public java.lang.String toXmlString() {
756                    return _role.toXmlString();
757            }
758    
759            public void persist()
760                    throws com.liferay.portal.kernel.exception.SystemException {
761                    _role.persist();
762            }
763    
764            public java.lang.String getDescriptiveName()
765                    throws com.liferay.portal.kernel.exception.PortalException,
766                            com.liferay.portal.kernel.exception.SystemException {
767                    return _role.getDescriptiveName();
768            }
769    
770            public java.lang.String getTypeLabel() {
771                    return _role.getTypeLabel();
772            }
773    
774            public boolean isTeam() {
775                    return _role.isTeam();
776            }
777    
778            /**
779             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
780             */
781            public Role getWrappedRole() {
782                    return _role;
783            }
784    
785            public Role getWrappedModel() {
786                    return _role;
787            }
788    
789            public void resetOriginalValues() {
790                    _role.resetOriginalValues();
791            }
792    
793            private Role _role;
794    }