1
22
23 package com.liferay.portlet.messageboards.model;
24
25 import java.io.Serializable;
26
27 import java.util.ArrayList;
28 import java.util.Date;
29 import java.util.List;
30
31
48 public class MBThreadSoap implements Serializable {
49 public static MBThreadSoap toSoapModel(MBThread model) {
50 MBThreadSoap soapModel = new MBThreadSoap();
51
52 soapModel.setThreadId(model.getThreadId());
53 soapModel.setGroupId(model.getGroupId());
54 soapModel.setCategoryId(model.getCategoryId());
55 soapModel.setRootMessageId(model.getRootMessageId());
56 soapModel.setMessageCount(model.getMessageCount());
57 soapModel.setViewCount(model.getViewCount());
58 soapModel.setLastPostByUserId(model.getLastPostByUserId());
59 soapModel.setLastPostDate(model.getLastPostDate());
60 soapModel.setPriority(model.getPriority());
61
62 return soapModel;
63 }
64
65 public static MBThreadSoap[] toSoapModels(MBThread[] models) {
66 MBThreadSoap[] soapModels = new MBThreadSoap[models.length];
67
68 for (int i = 0; i < models.length; i++) {
69 soapModels[i] = toSoapModel(models[i]);
70 }
71
72 return soapModels;
73 }
74
75 public static MBThreadSoap[][] toSoapModels(MBThread[][] models) {
76 MBThreadSoap[][] soapModels = null;
77
78 if (models.length > 0) {
79 soapModels = new MBThreadSoap[models.length][models[0].length];
80 }
81 else {
82 soapModels = new MBThreadSoap[0][0];
83 }
84
85 for (int i = 0; i < models.length; i++) {
86 soapModels[i] = toSoapModels(models[i]);
87 }
88
89 return soapModels;
90 }
91
92 public static MBThreadSoap[] toSoapModels(List<MBThread> models) {
93 List<MBThreadSoap> soapModels = new ArrayList<MBThreadSoap>(models.size());
94
95 for (MBThread model : models) {
96 soapModels.add(toSoapModel(model));
97 }
98
99 return soapModels.toArray(new MBThreadSoap[soapModels.size()]);
100 }
101
102 public MBThreadSoap() {
103 }
104
105 public long getPrimaryKey() {
106 return _threadId;
107 }
108
109 public void setPrimaryKey(long pk) {
110 setThreadId(pk);
111 }
112
113 public long getThreadId() {
114 return _threadId;
115 }
116
117 public void setThreadId(long threadId) {
118 _threadId = threadId;
119 }
120
121 public long getGroupId() {
122 return _groupId;
123 }
124
125 public void setGroupId(long groupId) {
126 _groupId = groupId;
127 }
128
129 public long getCategoryId() {
130 return _categoryId;
131 }
132
133 public void setCategoryId(long categoryId) {
134 _categoryId = categoryId;
135 }
136
137 public long getRootMessageId() {
138 return _rootMessageId;
139 }
140
141 public void setRootMessageId(long rootMessageId) {
142 _rootMessageId = rootMessageId;
143 }
144
145 public int getMessageCount() {
146 return _messageCount;
147 }
148
149 public void setMessageCount(int messageCount) {
150 _messageCount = messageCount;
151 }
152
153 public int getViewCount() {
154 return _viewCount;
155 }
156
157 public void setViewCount(int viewCount) {
158 _viewCount = viewCount;
159 }
160
161 public long getLastPostByUserId() {
162 return _lastPostByUserId;
163 }
164
165 public void setLastPostByUserId(long lastPostByUserId) {
166 _lastPostByUserId = lastPostByUserId;
167 }
168
169 public Date getLastPostDate() {
170 return _lastPostDate;
171 }
172
173 public void setLastPostDate(Date lastPostDate) {
174 _lastPostDate = lastPostDate;
175 }
176
177 public double getPriority() {
178 return _priority;
179 }
180
181 public void setPriority(double priority) {
182 _priority = priority;
183 }
184
185 private long _threadId;
186 private long _groupId;
187 private long _categoryId;
188 private long _rootMessageId;
189 private int _messageCount;
190 private int _viewCount;
191 private long _lastPostByUserId;
192 private Date _lastPostDate;
193 private double _priority;
194 }