001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.model;
016    
017    import com.liferay.portal.kernel.util.Validator;
018    
019    import java.util.HashMap;
020    import java.util.Map;
021    
022    /**
023     * <p>
024     * This class is a wrapper for {@link Role}.
025     * </p>
026     *
027     * @author    Brian Wing Shun Chan
028     * @see       Role
029     * @generated
030     */
031    public class RoleWrapper implements Role, ModelWrapper<Role> {
032            public RoleWrapper(Role role) {
033                    _role = role;
034            }
035    
036            public Class<?> getModelClass() {
037                    return Role.class;
038            }
039    
040            public String getModelClassName() {
041                    return Role.class.getName();
042            }
043    
044            public Map<String, Object> getModelAttributes() {
045                    Map<String, Object> attributes = new HashMap<String, Object>();
046    
047                    attributes.put("roleId", getRoleId());
048                    attributes.put("companyId", getCompanyId());
049                    attributes.put("classNameId", getClassNameId());
050                    attributes.put("classPK", getClassPK());
051                    attributes.put("name", getName());
052                    attributes.put("title", getTitle());
053                    attributes.put("description", getDescription());
054                    attributes.put("type", getType());
055                    attributes.put("subtype", getSubtype());
056    
057                    return attributes;
058            }
059    
060            public void setModelAttributes(Map<String, Object> attributes) {
061                    Long roleId = (Long)attributes.get("roleId");
062    
063                    if (roleId != null) {
064                            setRoleId(roleId);
065                    }
066    
067                    Long companyId = (Long)attributes.get("companyId");
068    
069                    if (companyId != null) {
070                            setCompanyId(companyId);
071                    }
072    
073                    Long classNameId = (Long)attributes.get("classNameId");
074    
075                    if (classNameId != null) {
076                            setClassNameId(classNameId);
077                    }
078    
079                    Long classPK = (Long)attributes.get("classPK");
080    
081                    if (classPK != null) {
082                            setClassPK(classPK);
083                    }
084    
085                    String name = (String)attributes.get("name");
086    
087                    if (name != null) {
088                            setName(name);
089                    }
090    
091                    String title = (String)attributes.get("title");
092    
093                    if (title != null) {
094                            setTitle(title);
095                    }
096    
097                    String description = (String)attributes.get("description");
098    
099                    if (description != null) {
100                            setDescription(description);
101                    }
102    
103                    Integer type = (Integer)attributes.get("type");
104    
105                    if (type != null) {
106                            setType(type);
107                    }
108    
109                    String subtype = (String)attributes.get("subtype");
110    
111                    if (subtype != null) {
112                            setSubtype(subtype);
113                    }
114            }
115    
116            /**
117            * Returns the primary key of this role.
118            *
119            * @return the primary key of this role
120            */
121            public long getPrimaryKey() {
122                    return _role.getPrimaryKey();
123            }
124    
125            /**
126            * Sets the primary key of this role.
127            *
128            * @param primaryKey the primary key of this role
129            */
130            public void setPrimaryKey(long primaryKey) {
131                    _role.setPrimaryKey(primaryKey);
132            }
133    
134            /**
135            * Returns the role ID of this role.
136            *
137            * @return the role ID of this role
138            */
139            public long getRoleId() {
140                    return _role.getRoleId();
141            }
142    
143            /**
144            * Sets the role ID of this role.
145            *
146            * @param roleId the role ID of this role
147            */
148            public void setRoleId(long roleId) {
149                    _role.setRoleId(roleId);
150            }
151    
152            /**
153            * Returns the company ID of this role.
154            *
155            * @return the company ID of this role
156            */
157            public long getCompanyId() {
158                    return _role.getCompanyId();
159            }
160    
161            /**
162            * Sets the company ID of this role.
163            *
164            * @param companyId the company ID of this role
165            */
166            public void setCompanyId(long companyId) {
167                    _role.setCompanyId(companyId);
168            }
169    
170            /**
171            * Returns the fully qualified class name of this role.
172            *
173            * @return the fully qualified class name of this role
174            */
175            public java.lang.String getClassName() {
176                    return _role.getClassName();
177            }
178    
179            public void setClassName(java.lang.String className) {
180                    _role.setClassName(className);
181            }
182    
183            /**
184            * Returns the class name ID of this role.
185            *
186            * @return the class name ID of this role
187            */
188            public long getClassNameId() {
189                    return _role.getClassNameId();
190            }
191    
192            /**
193            * Sets the class name ID of this role.
194            *
195            * @param classNameId the class name ID of this role
196            */
197            public void setClassNameId(long classNameId) {
198                    _role.setClassNameId(classNameId);
199            }
200    
201            /**
202            * Returns the class p k of this role.
203            *
204            * @return the class p k of this role
205            */
206            public long getClassPK() {
207                    return _role.getClassPK();
208            }
209    
210            /**
211            * Sets the class p k of this role.
212            *
213            * @param classPK the class p k of this role
214            */
215            public void setClassPK(long classPK) {
216                    _role.setClassPK(classPK);
217            }
218    
219            /**
220            * Returns the name of this role.
221            *
222            * @return the name of this role
223            */
224            public java.lang.String getName() {
225                    return _role.getName();
226            }
227    
228            /**
229            * Sets the name of this role.
230            *
231            * @param name the name of this role
232            */
233            public void setName(java.lang.String name) {
234                    _role.setName(name);
235            }
236    
237            /**
238            * Returns the title of this role.
239            *
240            * @return the title of this role
241            */
242            public java.lang.String getTitle() {
243                    return _role.getTitle();
244            }
245    
246            /**
247            * Returns the localized title of this role in the language. Uses the default language if no localization exists for the requested language.
248            *
249            * @param locale the locale of the language
250            * @return the localized title of this role
251            */
252            public java.lang.String getTitle(java.util.Locale locale) {
253                    return _role.getTitle(locale);
254            }
255    
256            /**
257            * Returns the localized title of this role in the language, optionally using the default language if no localization exists for the requested language.
258            *
259            * @param locale the local of the language
260            * @param useDefault whether to use the default language if no localization exists for the requested language
261            * @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.
262            */
263            public java.lang.String getTitle(java.util.Locale locale, boolean useDefault) {
264                    return _role.getTitle(locale, useDefault);
265            }
266    
267            /**
268            * Returns the localized title of this role in the language. Uses the default language if no localization exists for the requested language.
269            *
270            * @param languageId the ID of the language
271            * @return the localized title of this role
272            */
273            public java.lang.String getTitle(java.lang.String languageId) {
274                    return _role.getTitle(languageId);
275            }
276    
277            /**
278            * Returns the localized title of this role in the language, optionally using the default language if no localization exists for the requested language.
279            *
280            * @param languageId the ID of the language
281            * @param useDefault whether to use the default language if no localization exists for the requested language
282            * @return the localized title of this role
283            */
284            public java.lang.String getTitle(java.lang.String languageId,
285                    boolean useDefault) {
286                    return _role.getTitle(languageId, useDefault);
287            }
288    
289            public java.lang.String getTitleCurrentLanguageId() {
290                    return _role.getTitleCurrentLanguageId();
291            }
292    
293            public java.lang.String getTitleCurrentValue() {
294                    return _role.getTitleCurrentValue();
295            }
296    
297            /**
298            * Returns a map of the locales and localized titles of this role.
299            *
300            * @return the locales and localized titles of this role
301            */
302            public java.util.Map<java.util.Locale, java.lang.String> getTitleMap() {
303                    return _role.getTitleMap();
304            }
305    
306            /**
307            * Sets the title of this role.
308            *
309            * @param title the title of this role
310            */
311            public void setTitle(java.lang.String title) {
312                    _role.setTitle(title);
313            }
314    
315            /**
316            * Sets the localized title of this role in the language.
317            *
318            * @param title the localized title of this role
319            * @param locale the locale of the language
320            */
321            public void setTitle(java.lang.String title, java.util.Locale locale) {
322                    _role.setTitle(title, locale);
323            }
324    
325            /**
326            * Sets the localized title of this role in the language, and sets the default locale.
327            *
328            * @param title the localized title of this role
329            * @param locale the locale of the language
330            * @param defaultLocale the default locale
331            */
332            public void setTitle(java.lang.String title, java.util.Locale locale,
333                    java.util.Locale defaultLocale) {
334                    _role.setTitle(title, locale, defaultLocale);
335            }
336    
337            public void setTitleCurrentLanguageId(java.lang.String languageId) {
338                    _role.setTitleCurrentLanguageId(languageId);
339            }
340    
341            /**
342            * Sets the localized titles of this role from the map of locales and localized titles.
343            *
344            * @param titleMap the locales and localized titles of this role
345            */
346            public void setTitleMap(
347                    java.util.Map<java.util.Locale, java.lang.String> titleMap) {
348                    _role.setTitleMap(titleMap);
349            }
350    
351            /**
352            * Sets the localized titles of this role from the map of locales and localized titles, and sets the default locale.
353            *
354            * @param titleMap the locales and localized titles of this role
355            * @param defaultLocale the default locale
356            */
357            public void setTitleMap(
358                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
359                    java.util.Locale defaultLocale) {
360                    _role.setTitleMap(titleMap, defaultLocale);
361            }
362    
363            /**
364            * Returns the description of this role.
365            *
366            * @return the description of this role
367            */
368            public java.lang.String getDescription() {
369                    return _role.getDescription();
370            }
371    
372            /**
373            * Returns the localized description of this role in the language. Uses the default language if no localization exists for the requested language.
374            *
375            * @param locale the locale of the language
376            * @return the localized description of this role
377            */
378            public java.lang.String getDescription(java.util.Locale locale) {
379                    return _role.getDescription(locale);
380            }
381    
382            /**
383            * Returns the localized description of this role in the language, optionally using the default language if no localization exists for the requested language.
384            *
385            * @param locale the local of the language
386            * @param useDefault whether to use the default language if no localization exists for the requested language
387            * @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.
388            */
389            public java.lang.String getDescription(java.util.Locale locale,
390                    boolean useDefault) {
391                    return _role.getDescription(locale, useDefault);
392            }
393    
394            /**
395            * Returns the localized description of this role in the language. Uses the default language if no localization exists for the requested language.
396            *
397            * @param languageId the ID of the language
398            * @return the localized description of this role
399            */
400            public java.lang.String getDescription(java.lang.String languageId) {
401                    return _role.getDescription(languageId);
402            }
403    
404            /**
405            * Returns the localized description of this role in the language, optionally using the default language if no localization exists for the requested language.
406            *
407            * @param languageId the ID of the language
408            * @param useDefault whether to use the default language if no localization exists for the requested language
409            * @return the localized description of this role
410            */
411            public java.lang.String getDescription(java.lang.String languageId,
412                    boolean useDefault) {
413                    return _role.getDescription(languageId, useDefault);
414            }
415    
416            public java.lang.String getDescriptionCurrentLanguageId() {
417                    return _role.getDescriptionCurrentLanguageId();
418            }
419    
420            public java.lang.String getDescriptionCurrentValue() {
421                    return _role.getDescriptionCurrentValue();
422            }
423    
424            /**
425            * Returns a map of the locales and localized descriptions of this role.
426            *
427            * @return the locales and localized descriptions of this role
428            */
429            public java.util.Map<java.util.Locale, java.lang.String> getDescriptionMap() {
430                    return _role.getDescriptionMap();
431            }
432    
433            /**
434            * Sets the description of this role.
435            *
436            * @param description the description of this role
437            */
438            public void setDescription(java.lang.String description) {
439                    _role.setDescription(description);
440            }
441    
442            /**
443            * Sets the localized description of this role in the language.
444            *
445            * @param description the localized description of this role
446            * @param locale the locale of the language
447            */
448            public void setDescription(java.lang.String description,
449                    java.util.Locale locale) {
450                    _role.setDescription(description, locale);
451            }
452    
453            /**
454            * Sets the localized description of this role in the language, and sets the default locale.
455            *
456            * @param description the localized description of this role
457            * @param locale the locale of the language
458            * @param defaultLocale the default locale
459            */
460            public void setDescription(java.lang.String description,
461                    java.util.Locale locale, java.util.Locale defaultLocale) {
462                    _role.setDescription(description, locale, defaultLocale);
463            }
464    
465            public void setDescriptionCurrentLanguageId(java.lang.String languageId) {
466                    _role.setDescriptionCurrentLanguageId(languageId);
467            }
468    
469            /**
470            * Sets the localized descriptions of this role from the map of locales and localized descriptions.
471            *
472            * @param descriptionMap the locales and localized descriptions of this role
473            */
474            public void setDescriptionMap(
475                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap) {
476                    _role.setDescriptionMap(descriptionMap);
477            }
478    
479            /**
480            * Sets the localized descriptions of this role from the map of locales and localized descriptions, and sets the default locale.
481            *
482            * @param descriptionMap the locales and localized descriptions of this role
483            * @param defaultLocale the default locale
484            */
485            public void setDescriptionMap(
486                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
487                    java.util.Locale defaultLocale) {
488                    _role.setDescriptionMap(descriptionMap, defaultLocale);
489            }
490    
491            /**
492            * Returns the type of this role.
493            *
494            * @return the type of this role
495            */
496            public int getType() {
497                    return _role.getType();
498            }
499    
500            /**
501            * Sets the type of this role.
502            *
503            * @param type the type of this role
504            */
505            public void setType(int type) {
506                    _role.setType(type);
507            }
508    
509            /**
510            * Returns the subtype of this role.
511            *
512            * @return the subtype of this role
513            */
514            public java.lang.String getSubtype() {
515                    return _role.getSubtype();
516            }
517    
518            /**
519            * Sets the subtype of this role.
520            *
521            * @param subtype the subtype of this role
522            */
523            public void setSubtype(java.lang.String subtype) {
524                    _role.setSubtype(subtype);
525            }
526    
527            public boolean isNew() {
528                    return _role.isNew();
529            }
530    
531            public void setNew(boolean n) {
532                    _role.setNew(n);
533            }
534    
535            public boolean isCachedModel() {
536                    return _role.isCachedModel();
537            }
538    
539            public void setCachedModel(boolean cachedModel) {
540                    _role.setCachedModel(cachedModel);
541            }
542    
543            public boolean isEscapedModel() {
544                    return _role.isEscapedModel();
545            }
546    
547            public java.io.Serializable getPrimaryKeyObj() {
548                    return _role.getPrimaryKeyObj();
549            }
550    
551            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
552                    _role.setPrimaryKeyObj(primaryKeyObj);
553            }
554    
555            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
556                    return _role.getExpandoBridge();
557            }
558    
559            public void setExpandoBridgeAttributes(
560                    com.liferay.portal.service.ServiceContext serviceContext) {
561                    _role.setExpandoBridgeAttributes(serviceContext);
562            }
563    
564            public void prepareLocalizedFieldsForImport(
565                    java.util.Locale defaultImportLocale)
566                    throws com.liferay.portal.LocaleException {
567                    _role.prepareLocalizedFieldsForImport(defaultImportLocale);
568            }
569    
570            @Override
571            public java.lang.Object clone() {
572                    return new RoleWrapper((Role)_role.clone());
573            }
574    
575            public int compareTo(com.liferay.portal.model.Role role) {
576                    return _role.compareTo(role);
577            }
578    
579            @Override
580            public int hashCode() {
581                    return _role.hashCode();
582            }
583    
584            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.Role> toCacheModel() {
585                    return _role.toCacheModel();
586            }
587    
588            public com.liferay.portal.model.Role toEscapedModel() {
589                    return new RoleWrapper(_role.toEscapedModel());
590            }
591    
592            public com.liferay.portal.model.Role toUnescapedModel() {
593                    return new RoleWrapper(_role.toUnescapedModel());
594            }
595    
596            @Override
597            public java.lang.String toString() {
598                    return _role.toString();
599            }
600    
601            public java.lang.String toXmlString() {
602                    return _role.toXmlString();
603            }
604    
605            public void persist()
606                    throws com.liferay.portal.kernel.exception.SystemException {
607                    _role.persist();
608            }
609    
610            public java.lang.String getDescriptiveName()
611                    throws com.liferay.portal.kernel.exception.PortalException,
612                            com.liferay.portal.kernel.exception.SystemException {
613                    return _role.getDescriptiveName();
614            }
615    
616            public java.lang.String getTypeLabel() {
617                    return _role.getTypeLabel();
618            }
619    
620            public boolean isTeam() {
621                    return _role.isTeam();
622            }
623    
624            @Override
625            public boolean equals(Object obj) {
626                    if (this == obj) {
627                            return true;
628                    }
629    
630                    if (!(obj instanceof RoleWrapper)) {
631                            return false;
632                    }
633    
634                    RoleWrapper roleWrapper = (RoleWrapper)obj;
635    
636                    if (Validator.equals(_role, roleWrapper._role)) {
637                            return true;
638                    }
639    
640                    return false;
641            }
642    
643            /**
644             * @deprecated Renamed to {@link #getWrappedModel}
645             */
646            public Role getWrappedRole() {
647                    return _role;
648            }
649    
650            public Role getWrappedModel() {
651                    return _role;
652            }
653    
654            public void resetOriginalValues() {
655                    _role.resetOriginalValues();
656            }
657    
658            private Role _role;
659    }