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