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