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