001
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
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
121 public long getPrimaryKey() {
122 return _role.getPrimaryKey();
123 }
124
125
130 public void setPrimaryKey(long primaryKey) {
131 _role.setPrimaryKey(primaryKey);
132 }
133
134
139 public long getRoleId() {
140 return _role.getRoleId();
141 }
142
143
148 public void setRoleId(long roleId) {
149 _role.setRoleId(roleId);
150 }
151
152
157 public long getCompanyId() {
158 return _role.getCompanyId();
159 }
160
161
166 public void setCompanyId(long companyId) {
167 _role.setCompanyId(companyId);
168 }
169
170
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
188 public long getClassNameId() {
189 return _role.getClassNameId();
190 }
191
192
197 public void setClassNameId(long classNameId) {
198 _role.setClassNameId(classNameId);
199 }
200
201
206 public long getClassPK() {
207 return _role.getClassPK();
208 }
209
210
215 public void setClassPK(long classPK) {
216 _role.setClassPK(classPK);
217 }
218
219
224 public java.lang.String getName() {
225 return _role.getName();
226 }
227
228
233 public void setName(java.lang.String name) {
234 _role.setName(name);
235 }
236
237
242 public java.lang.String getTitle() {
243 return _role.getTitle();
244 }
245
246
252 public java.lang.String getTitle(java.util.Locale locale) {
253 return _role.getTitle(locale);
254 }
255
256
263 public java.lang.String getTitle(java.util.Locale locale, boolean useDefault) {
264 return _role.getTitle(locale, useDefault);
265 }
266
267
273 public java.lang.String getTitle(java.lang.String languageId) {
274 return _role.getTitle(languageId);
275 }
276
277
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
302 public java.util.Map<java.util.Locale, java.lang.String> getTitleMap() {
303 return _role.getTitleMap();
304 }
305
306
311 public void setTitle(java.lang.String title) {
312 _role.setTitle(title);
313 }
314
315
321 public void setTitle(java.lang.String title, java.util.Locale locale) {
322 _role.setTitle(title, locale);
323 }
324
325
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
346 public void setTitleMap(
347 java.util.Map<java.util.Locale, java.lang.String> titleMap) {
348 _role.setTitleMap(titleMap);
349 }
350
351
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
368 public java.lang.String getDescription() {
369 return _role.getDescription();
370 }
371
372
378 public java.lang.String getDescription(java.util.Locale locale) {
379 return _role.getDescription(locale);
380 }
381
382
389 public java.lang.String getDescription(java.util.Locale locale,
390 boolean useDefault) {
391 return _role.getDescription(locale, useDefault);
392 }
393
394
400 public java.lang.String getDescription(java.lang.String languageId) {
401 return _role.getDescription(languageId);
402 }
403
404
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
429 public java.util.Map<java.util.Locale, java.lang.String> getDescriptionMap() {
430 return _role.getDescriptionMap();
431 }
432
433
438 public void setDescription(java.lang.String description) {
439 _role.setDescription(description);
440 }
441
442
448 public void setDescription(java.lang.String description,
449 java.util.Locale locale) {
450 _role.setDescription(description, locale);
451 }
452
453
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
474 public void setDescriptionMap(
475 java.util.Map<java.util.Locale, java.lang.String> descriptionMap) {
476 _role.setDescriptionMap(descriptionMap);
477 }
478
479
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
496 public int getType() {
497 return _role.getType();
498 }
499
500
505 public void setType(int type) {
506 _role.setType(type);
507 }
508
509
514 public java.lang.String getSubtype() {
515 return _role.getSubtype();
516 }
517
518
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
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 }