001
014
015 package com.liferay.portlet.messageboards.model;
016
017 import com.liferay.portal.kernel.util.Validator;
018 import com.liferay.portal.model.ModelWrapper;
019
020 import java.util.Date;
021 import java.util.HashMap;
022 import java.util.Map;
023
024
033 public class MBMessageWrapper implements MBMessage, ModelWrapper<MBMessage> {
034 public MBMessageWrapper(MBMessage mbMessage) {
035 _mbMessage = mbMessage;
036 }
037
038 public Class<?> getModelClass() {
039 return MBMessage.class;
040 }
041
042 public String getModelClassName() {
043 return MBMessage.class.getName();
044 }
045
046 public Map<String, Object> getModelAttributes() {
047 Map<String, Object> attributes = new HashMap<String, Object>();
048
049 attributes.put("uuid", getUuid());
050 attributes.put("messageId", getMessageId());
051 attributes.put("groupId", getGroupId());
052 attributes.put("companyId", getCompanyId());
053 attributes.put("userId", getUserId());
054 attributes.put("userName", getUserName());
055 attributes.put("createDate", getCreateDate());
056 attributes.put("modifiedDate", getModifiedDate());
057 attributes.put("classNameId", getClassNameId());
058 attributes.put("classPK", getClassPK());
059 attributes.put("categoryId", getCategoryId());
060 attributes.put("threadId", getThreadId());
061 attributes.put("rootMessageId", getRootMessageId());
062 attributes.put("parentMessageId", getParentMessageId());
063 attributes.put("subject", getSubject());
064 attributes.put("body", getBody());
065 attributes.put("format", getFormat());
066 attributes.put("attachments", getAttachments());
067 attributes.put("anonymous", getAnonymous());
068 attributes.put("priority", getPriority());
069 attributes.put("allowPingbacks", getAllowPingbacks());
070 attributes.put("answer", getAnswer());
071 attributes.put("status", getStatus());
072 attributes.put("statusByUserId", getStatusByUserId());
073 attributes.put("statusByUserName", getStatusByUserName());
074 attributes.put("statusDate", getStatusDate());
075
076 return attributes;
077 }
078
079 public void setModelAttributes(Map<String, Object> attributes) {
080 String uuid = (String)attributes.get("uuid");
081
082 if (uuid != null) {
083 setUuid(uuid);
084 }
085
086 Long messageId = (Long)attributes.get("messageId");
087
088 if (messageId != null) {
089 setMessageId(messageId);
090 }
091
092 Long groupId = (Long)attributes.get("groupId");
093
094 if (groupId != null) {
095 setGroupId(groupId);
096 }
097
098 Long companyId = (Long)attributes.get("companyId");
099
100 if (companyId != null) {
101 setCompanyId(companyId);
102 }
103
104 Long userId = (Long)attributes.get("userId");
105
106 if (userId != null) {
107 setUserId(userId);
108 }
109
110 String userName = (String)attributes.get("userName");
111
112 if (userName != null) {
113 setUserName(userName);
114 }
115
116 Date createDate = (Date)attributes.get("createDate");
117
118 if (createDate != null) {
119 setCreateDate(createDate);
120 }
121
122 Date modifiedDate = (Date)attributes.get("modifiedDate");
123
124 if (modifiedDate != null) {
125 setModifiedDate(modifiedDate);
126 }
127
128 Long classNameId = (Long)attributes.get("classNameId");
129
130 if (classNameId != null) {
131 setClassNameId(classNameId);
132 }
133
134 Long classPK = (Long)attributes.get("classPK");
135
136 if (classPK != null) {
137 setClassPK(classPK);
138 }
139
140 Long categoryId = (Long)attributes.get("categoryId");
141
142 if (categoryId != null) {
143 setCategoryId(categoryId);
144 }
145
146 Long threadId = (Long)attributes.get("threadId");
147
148 if (threadId != null) {
149 setThreadId(threadId);
150 }
151
152 Long rootMessageId = (Long)attributes.get("rootMessageId");
153
154 if (rootMessageId != null) {
155 setRootMessageId(rootMessageId);
156 }
157
158 Long parentMessageId = (Long)attributes.get("parentMessageId");
159
160 if (parentMessageId != null) {
161 setParentMessageId(parentMessageId);
162 }
163
164 String subject = (String)attributes.get("subject");
165
166 if (subject != null) {
167 setSubject(subject);
168 }
169
170 String body = (String)attributes.get("body");
171
172 if (body != null) {
173 setBody(body);
174 }
175
176 String format = (String)attributes.get("format");
177
178 if (format != null) {
179 setFormat(format);
180 }
181
182 Boolean attachments = (Boolean)attributes.get("attachments");
183
184 if (attachments != null) {
185 setAttachments(attachments);
186 }
187
188 Boolean anonymous = (Boolean)attributes.get("anonymous");
189
190 if (anonymous != null) {
191 setAnonymous(anonymous);
192 }
193
194 Double priority = (Double)attributes.get("priority");
195
196 if (priority != null) {
197 setPriority(priority);
198 }
199
200 Boolean allowPingbacks = (Boolean)attributes.get("allowPingbacks");
201
202 if (allowPingbacks != null) {
203 setAllowPingbacks(allowPingbacks);
204 }
205
206 Boolean answer = (Boolean)attributes.get("answer");
207
208 if (answer != null) {
209 setAnswer(answer);
210 }
211
212 Integer status = (Integer)attributes.get("status");
213
214 if (status != null) {
215 setStatus(status);
216 }
217
218 Long statusByUserId = (Long)attributes.get("statusByUserId");
219
220 if (statusByUserId != null) {
221 setStatusByUserId(statusByUserId);
222 }
223
224 String statusByUserName = (String)attributes.get("statusByUserName");
225
226 if (statusByUserName != null) {
227 setStatusByUserName(statusByUserName);
228 }
229
230 Date statusDate = (Date)attributes.get("statusDate");
231
232 if (statusDate != null) {
233 setStatusDate(statusDate);
234 }
235 }
236
237
242 public long getPrimaryKey() {
243 return _mbMessage.getPrimaryKey();
244 }
245
246
251 public void setPrimaryKey(long primaryKey) {
252 _mbMessage.setPrimaryKey(primaryKey);
253 }
254
255
260 public java.lang.String getUuid() {
261 return _mbMessage.getUuid();
262 }
263
264
269 public void setUuid(java.lang.String uuid) {
270 _mbMessage.setUuid(uuid);
271 }
272
273
278 public long getMessageId() {
279 return _mbMessage.getMessageId();
280 }
281
282
287 public void setMessageId(long messageId) {
288 _mbMessage.setMessageId(messageId);
289 }
290
291
296 public long getGroupId() {
297 return _mbMessage.getGroupId();
298 }
299
300
305 public void setGroupId(long groupId) {
306 _mbMessage.setGroupId(groupId);
307 }
308
309
314 public long getCompanyId() {
315 return _mbMessage.getCompanyId();
316 }
317
318
323 public void setCompanyId(long companyId) {
324 _mbMessage.setCompanyId(companyId);
325 }
326
327
332 public long getUserId() {
333 return _mbMessage.getUserId();
334 }
335
336
341 public void setUserId(long userId) {
342 _mbMessage.setUserId(userId);
343 }
344
345
351 public java.lang.String getUserUuid()
352 throws com.liferay.portal.kernel.exception.SystemException {
353 return _mbMessage.getUserUuid();
354 }
355
356
361 public void setUserUuid(java.lang.String userUuid) {
362 _mbMessage.setUserUuid(userUuid);
363 }
364
365
370 public java.lang.String getUserName() {
371 return _mbMessage.getUserName();
372 }
373
374
379 public void setUserName(java.lang.String userName) {
380 _mbMessage.setUserName(userName);
381 }
382
383
388 public java.util.Date getCreateDate() {
389 return _mbMessage.getCreateDate();
390 }
391
392
397 public void setCreateDate(java.util.Date createDate) {
398 _mbMessage.setCreateDate(createDate);
399 }
400
401
406 public java.util.Date getModifiedDate() {
407 return _mbMessage.getModifiedDate();
408 }
409
410
415 public void setModifiedDate(java.util.Date modifiedDate) {
416 _mbMessage.setModifiedDate(modifiedDate);
417 }
418
419
424 public java.lang.String getClassName() {
425 return _mbMessage.getClassName();
426 }
427
428 public void setClassName(java.lang.String className) {
429 _mbMessage.setClassName(className);
430 }
431
432
437 public long getClassNameId() {
438 return _mbMessage.getClassNameId();
439 }
440
441
446 public void setClassNameId(long classNameId) {
447 _mbMessage.setClassNameId(classNameId);
448 }
449
450
455 public long getClassPK() {
456 return _mbMessage.getClassPK();
457 }
458
459
464 public void setClassPK(long classPK) {
465 _mbMessage.setClassPK(classPK);
466 }
467
468
473 public long getCategoryId() {
474 return _mbMessage.getCategoryId();
475 }
476
477
482 public void setCategoryId(long categoryId) {
483 _mbMessage.setCategoryId(categoryId);
484 }
485
486
491 public long getThreadId() {
492 return _mbMessage.getThreadId();
493 }
494
495
500 public void setThreadId(long threadId) {
501 _mbMessage.setThreadId(threadId);
502 }
503
504
509 public long getRootMessageId() {
510 return _mbMessage.getRootMessageId();
511 }
512
513
518 public void setRootMessageId(long rootMessageId) {
519 _mbMessage.setRootMessageId(rootMessageId);
520 }
521
522
527 public long getParentMessageId() {
528 return _mbMessage.getParentMessageId();
529 }
530
531
536 public void setParentMessageId(long parentMessageId) {
537 _mbMessage.setParentMessageId(parentMessageId);
538 }
539
540
545 public java.lang.String getSubject() {
546 return _mbMessage.getSubject();
547 }
548
549
554 public void setSubject(java.lang.String subject) {
555 _mbMessage.setSubject(subject);
556 }
557
558
563 public java.lang.String getBody() {
564 return _mbMessage.getBody();
565 }
566
567
572 public void setBody(java.lang.String body) {
573 _mbMessage.setBody(body);
574 }
575
576
581 public java.lang.String getFormat() {
582 return _mbMessage.getFormat();
583 }
584
585
590 public void setFormat(java.lang.String format) {
591 _mbMessage.setFormat(format);
592 }
593
594
599 public boolean getAttachments() {
600 return _mbMessage.getAttachments();
601 }
602
603
608 public boolean isAttachments() {
609 return _mbMessage.isAttachments();
610 }
611
612
617 public void setAttachments(boolean attachments) {
618 _mbMessage.setAttachments(attachments);
619 }
620
621
626 public boolean getAnonymous() {
627 return _mbMessage.getAnonymous();
628 }
629
630
635 public boolean isAnonymous() {
636 return _mbMessage.isAnonymous();
637 }
638
639
644 public void setAnonymous(boolean anonymous) {
645 _mbMessage.setAnonymous(anonymous);
646 }
647
648
653 public double getPriority() {
654 return _mbMessage.getPriority();
655 }
656
657
662 public void setPriority(double priority) {
663 _mbMessage.setPriority(priority);
664 }
665
666
671 public boolean getAllowPingbacks() {
672 return _mbMessage.getAllowPingbacks();
673 }
674
675
680 public boolean isAllowPingbacks() {
681 return _mbMessage.isAllowPingbacks();
682 }
683
684
689 public void setAllowPingbacks(boolean allowPingbacks) {
690 _mbMessage.setAllowPingbacks(allowPingbacks);
691 }
692
693
698 public boolean getAnswer() {
699 return _mbMessage.getAnswer();
700 }
701
702
707 public boolean isAnswer() {
708 return _mbMessage.isAnswer();
709 }
710
711
716 public void setAnswer(boolean answer) {
717 _mbMessage.setAnswer(answer);
718 }
719
720
725 public int getStatus() {
726 return _mbMessage.getStatus();
727 }
728
729
734 public void setStatus(int status) {
735 _mbMessage.setStatus(status);
736 }
737
738
743 public long getStatusByUserId() {
744 return _mbMessage.getStatusByUserId();
745 }
746
747
752 public void setStatusByUserId(long statusByUserId) {
753 _mbMessage.setStatusByUserId(statusByUserId);
754 }
755
756
762 public java.lang.String getStatusByUserUuid()
763 throws com.liferay.portal.kernel.exception.SystemException {
764 return _mbMessage.getStatusByUserUuid();
765 }
766
767
772 public void setStatusByUserUuid(java.lang.String statusByUserUuid) {
773 _mbMessage.setStatusByUserUuid(statusByUserUuid);
774 }
775
776
781 public java.lang.String getStatusByUserName() {
782 return _mbMessage.getStatusByUserName();
783 }
784
785
790 public void setStatusByUserName(java.lang.String statusByUserName) {
791 _mbMessage.setStatusByUserName(statusByUserName);
792 }
793
794
799 public java.util.Date getStatusDate() {
800 return _mbMessage.getStatusDate();
801 }
802
803
808 public void setStatusDate(java.util.Date statusDate) {
809 _mbMessage.setStatusDate(statusDate);
810 }
811
812
815 public boolean getApproved() {
816 return _mbMessage.getApproved();
817 }
818
819
824 public boolean isApproved() {
825 return _mbMessage.isApproved();
826 }
827
828
833 public boolean isDenied() {
834 return _mbMessage.isDenied();
835 }
836
837
842 public boolean isDraft() {
843 return _mbMessage.isDraft();
844 }
845
846
851 public boolean isExpired() {
852 return _mbMessage.isExpired();
853 }
854
855
860 public boolean isInactive() {
861 return _mbMessage.isInactive();
862 }
863
864
869 public boolean isIncomplete() {
870 return _mbMessage.isIncomplete();
871 }
872
873
878 public boolean isPending() {
879 return _mbMessage.isPending();
880 }
881
882
887 public boolean isScheduled() {
888 return _mbMessage.isScheduled();
889 }
890
891 public boolean isNew() {
892 return _mbMessage.isNew();
893 }
894
895 public void setNew(boolean n) {
896 _mbMessage.setNew(n);
897 }
898
899 public boolean isCachedModel() {
900 return _mbMessage.isCachedModel();
901 }
902
903 public void setCachedModel(boolean cachedModel) {
904 _mbMessage.setCachedModel(cachedModel);
905 }
906
907 public boolean isEscapedModel() {
908 return _mbMessage.isEscapedModel();
909 }
910
911 public java.io.Serializable getPrimaryKeyObj() {
912 return _mbMessage.getPrimaryKeyObj();
913 }
914
915 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
916 _mbMessage.setPrimaryKeyObj(primaryKeyObj);
917 }
918
919 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
920 return _mbMessage.getExpandoBridge();
921 }
922
923 public void setExpandoBridgeAttributes(
924 com.liferay.portal.service.ServiceContext serviceContext) {
925 _mbMessage.setExpandoBridgeAttributes(serviceContext);
926 }
927
928 @Override
929 public java.lang.Object clone() {
930 return new MBMessageWrapper((MBMessage)_mbMessage.clone());
931 }
932
933 public int compareTo(
934 com.liferay.portlet.messageboards.model.MBMessage mbMessage) {
935 return _mbMessage.compareTo(mbMessage);
936 }
937
938 @Override
939 public int hashCode() {
940 return _mbMessage.hashCode();
941 }
942
943 public com.liferay.portal.model.CacheModel<com.liferay.portlet.messageboards.model.MBMessage> toCacheModel() {
944 return _mbMessage.toCacheModel();
945 }
946
947 public com.liferay.portlet.messageboards.model.MBMessage toEscapedModel() {
948 return new MBMessageWrapper(_mbMessage.toEscapedModel());
949 }
950
951 public com.liferay.portlet.messageboards.model.MBMessage toUnescapedModel() {
952 return new MBMessageWrapper(_mbMessage.toUnescapedModel());
953 }
954
955 @Override
956 public java.lang.String toString() {
957 return _mbMessage.toString();
958 }
959
960 public java.lang.String toXmlString() {
961 return _mbMessage.toXmlString();
962 }
963
964 public void persist()
965 throws com.liferay.portal.kernel.exception.SystemException {
966 _mbMessage.persist();
967 }
968
969 public java.lang.String[] getAssetTagNames()
970 throws com.liferay.portal.kernel.exception.SystemException {
971 return _mbMessage.getAssetTagNames();
972 }
973
974 public java.lang.String getAttachmentsDir() {
975 return _mbMessage.getAttachmentsDir();
976 }
977
978 public java.lang.String[] getAttachmentsFiles()
979 throws com.liferay.portal.kernel.exception.PortalException,
980 com.liferay.portal.kernel.exception.SystemException {
981 return _mbMessage.getAttachmentsFiles();
982 }
983
984 public java.lang.String getBody(boolean translate) {
985 return _mbMessage.getBody(translate);
986 }
987
988 public com.liferay.portlet.messageboards.model.MBCategory getCategory()
989 throws com.liferay.portal.kernel.exception.PortalException,
990 com.liferay.portal.kernel.exception.SystemException {
991 return _mbMessage.getCategory();
992 }
993
994 public com.liferay.portlet.messageboards.model.MBThread getThread()
995 throws com.liferay.portal.kernel.exception.PortalException,
996 com.liferay.portal.kernel.exception.SystemException {
997 return _mbMessage.getThread();
998 }
999
1000 public java.lang.String getThreadAttachmentsDir() {
1001 return _mbMessage.getThreadAttachmentsDir();
1002 }
1003
1004 public java.lang.String getWorkflowClassName() {
1005 return _mbMessage.getWorkflowClassName();
1006 }
1007
1008 public boolean isDiscussion() {
1009 return _mbMessage.isDiscussion();
1010 }
1011
1012 public boolean isFormatBBCode() {
1013 return _mbMessage.isFormatBBCode();
1014 }
1015
1016 public boolean isReply() {
1017 return _mbMessage.isReply();
1018 }
1019
1020 public boolean isRoot() {
1021 return _mbMessage.isRoot();
1022 }
1023
1024 public void setAttachmentsDir(java.lang.String attachmentsDir) {
1025 _mbMessage.setAttachmentsDir(attachmentsDir);
1026 }
1027
1028 @Override
1029 public boolean equals(Object obj) {
1030 if (this == obj) {
1031 return true;
1032 }
1033
1034 if (!(obj instanceof MBMessageWrapper)) {
1035 return false;
1036 }
1037
1038 MBMessageWrapper mbMessageWrapper = (MBMessageWrapper)obj;
1039
1040 if (Validator.equals(_mbMessage, mbMessageWrapper._mbMessage)) {
1041 return true;
1042 }
1043
1044 return false;
1045 }
1046
1047
1050 public MBMessage getWrappedMBMessage() {
1051 return _mbMessage;
1052 }
1053
1054 public MBMessage getWrappedModel() {
1055 return _mbMessage;
1056 }
1057
1058 public void resetOriginalValues() {
1059 _mbMessage.resetOriginalValues();
1060 }
1061
1062 private MBMessage _mbMessage;
1063 }