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