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