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