| 305 |
ashish |
1 |
/**
|
| 3430 |
rajveer |
2 |
* Autogenerated by Thrift Compiler (0.7.0)
|
| 305 |
ashish |
3 |
*
|
|
|
4 |
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
|
5 |
*/
|
|
|
6 |
package in.shop2020.model.v1.order;
|
|
|
7 |
|
|
|
8 |
import java.util.List;
|
|
|
9 |
import java.util.ArrayList;
|
|
|
10 |
import java.util.Map;
|
|
|
11 |
import java.util.HashMap;
|
|
|
12 |
import java.util.EnumMap;
|
|
|
13 |
import java.util.Set;
|
|
|
14 |
import java.util.HashSet;
|
|
|
15 |
import java.util.EnumSet;
|
|
|
16 |
import java.util.Collections;
|
|
|
17 |
import java.util.BitSet;
|
| 3430 |
rajveer |
18 |
import java.nio.ByteBuffer;
|
| 305 |
ashish |
19 |
import java.util.Arrays;
|
|
|
20 |
import org.slf4j.Logger;
|
|
|
21 |
import org.slf4j.LoggerFactory;
|
|
|
22 |
|
| 3430 |
rajveer |
23 |
public class Alert implements org.apache.thrift.TBase<Alert, Alert._Fields>, java.io.Serializable, Cloneable {
|
|
|
24 |
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Alert");
|
| 305 |
ashish |
25 |
|
| 3430 |
rajveer |
26 |
private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
|
| 4393 |
rajveer |
27 |
private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)2);
|
|
|
28 |
private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I64, (short)3);
|
|
|
29 |
private static final org.apache.thrift.protocol.TField TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("timestamp", org.apache.thrift.protocol.TType.I64, (short)4);
|
|
|
30 |
private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short)5);
|
| 4444 |
rajveer |
31 |
private static final org.apache.thrift.protocol.TField WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouseId", org.apache.thrift.protocol.TType.I64, (short)6);
|
| 305 |
ashish |
32 |
|
| 3430 |
rajveer |
33 |
private long id; // required
|
| 4393 |
rajveer |
34 |
private AlertType type; // required
|
|
|
35 |
private long status; // required
|
|
|
36 |
private long timestamp; // required
|
|
|
37 |
private String description; // required
|
| 4444 |
rajveer |
38 |
private long warehouseId; // required
|
| 305 |
ashish |
39 |
|
|
|
40 |
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
|
| 3430 |
rajveer |
41 |
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
|
| 305 |
ashish |
42 |
ID((short)1, "id"),
|
| 4393 |
rajveer |
43 |
/**
|
|
|
44 |
*
|
|
|
45 |
* @see AlertType
|
|
|
46 |
*/
|
|
|
47 |
TYPE((short)2, "type"),
|
|
|
48 |
STATUS((short)3, "status"),
|
|
|
49 |
TIMESTAMP((short)4, "timestamp"),
|
| 4444 |
rajveer |
50 |
DESCRIPTION((short)5, "description"),
|
|
|
51 |
WAREHOUSE_ID((short)6, "warehouseId");
|
| 305 |
ashish |
52 |
|
|
|
53 |
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
|
|
54 |
|
|
|
55 |
static {
|
|
|
56 |
for (_Fields field : EnumSet.allOf(_Fields.class)) {
|
|
|
57 |
byName.put(field.getFieldName(), field);
|
|
|
58 |
}
|
|
|
59 |
}
|
|
|
60 |
|
|
|
61 |
/**
|
|
|
62 |
* Find the _Fields constant that matches fieldId, or null if its not found.
|
|
|
63 |
*/
|
|
|
64 |
public static _Fields findByThriftId(int fieldId) {
|
| 3430 |
rajveer |
65 |
switch(fieldId) {
|
|
|
66 |
case 1: // ID
|
|
|
67 |
return ID;
|
| 4393 |
rajveer |
68 |
case 2: // TYPE
|
| 3430 |
rajveer |
69 |
return TYPE;
|
| 4393 |
rajveer |
70 |
case 3: // STATUS
|
|
|
71 |
return STATUS;
|
|
|
72 |
case 4: // TIMESTAMP
|
|
|
73 |
return TIMESTAMP;
|
|
|
74 |
case 5: // DESCRIPTION
|
|
|
75 |
return DESCRIPTION;
|
| 4444 |
rajveer |
76 |
case 6: // WAREHOUSE_ID
|
|
|
77 |
return WAREHOUSE_ID;
|
| 3430 |
rajveer |
78 |
default:
|
|
|
79 |
return null;
|
|
|
80 |
}
|
| 305 |
ashish |
81 |
}
|
|
|
82 |
|
|
|
83 |
/**
|
|
|
84 |
* Find the _Fields constant that matches fieldId, throwing an exception
|
|
|
85 |
* if it is not found.
|
|
|
86 |
*/
|
|
|
87 |
public static _Fields findByThriftIdOrThrow(int fieldId) {
|
|
|
88 |
_Fields fields = findByThriftId(fieldId);
|
|
|
89 |
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
|
|
|
90 |
return fields;
|
|
|
91 |
}
|
|
|
92 |
|
|
|
93 |
/**
|
|
|
94 |
* Find the _Fields constant that matches name, or null if its not found.
|
|
|
95 |
*/
|
|
|
96 |
public static _Fields findByName(String name) {
|
|
|
97 |
return byName.get(name);
|
|
|
98 |
}
|
|
|
99 |
|
|
|
100 |
private final short _thriftId;
|
|
|
101 |
private final String _fieldName;
|
|
|
102 |
|
|
|
103 |
_Fields(short thriftId, String fieldName) {
|
|
|
104 |
_thriftId = thriftId;
|
|
|
105 |
_fieldName = fieldName;
|
|
|
106 |
}
|
|
|
107 |
|
|
|
108 |
public short getThriftFieldId() {
|
|
|
109 |
return _thriftId;
|
|
|
110 |
}
|
|
|
111 |
|
|
|
112 |
public String getFieldName() {
|
|
|
113 |
return _fieldName;
|
|
|
114 |
}
|
|
|
115 |
}
|
|
|
116 |
|
|
|
117 |
// isset id assignments
|
|
|
118 |
private static final int __ID_ISSET_ID = 0;
|
| 4393 |
rajveer |
119 |
private static final int __STATUS_ISSET_ID = 1;
|
|
|
120 |
private static final int __TIMESTAMP_ISSET_ID = 2;
|
| 4444 |
rajveer |
121 |
private static final int __WAREHOUSEID_ISSET_ID = 3;
|
|
|
122 |
private BitSet __isset_bit_vector = new BitSet(4);
|
| 305 |
ashish |
123 |
|
| 3430 |
rajveer |
124 |
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
|
| 305 |
ashish |
125 |
static {
|
| 3430 |
rajveer |
126 |
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
|
|
|
127 |
tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
128 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
|
|
129 |
tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
| 4393 |
rajveer |
130 |
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, AlertType.class)));
|
|
|
131 |
tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
| 3430 |
rajveer |
132 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
| 4393 |
rajveer |
133 |
tmpMap.put(_Fields.TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("timestamp", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
| 3430 |
rajveer |
134 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
| 4393 |
rajveer |
135 |
tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
| 3430 |
rajveer |
136 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
|
| 4444 |
rajveer |
137 |
tmpMap.put(_Fields.WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("warehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT,
|
|
|
138 |
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
|
| 3430 |
rajveer |
139 |
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
|
|
140 |
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Alert.class, metaDataMap);
|
| 305 |
ashish |
141 |
}
|
|
|
142 |
|
|
|
143 |
public Alert() {
|
|
|
144 |
}
|
|
|
145 |
|
|
|
146 |
public Alert(
|
|
|
147 |
long id,
|
| 4393 |
rajveer |
148 |
AlertType type,
|
|
|
149 |
long status,
|
|
|
150 |
long timestamp,
|
| 4444 |
rajveer |
151 |
String description,
|
|
|
152 |
long warehouseId)
|
| 305 |
ashish |
153 |
{
|
|
|
154 |
this();
|
|
|
155 |
this.id = id;
|
|
|
156 |
setIdIsSet(true);
|
|
|
157 |
this.type = type;
|
| 4393 |
rajveer |
158 |
this.status = status;
|
|
|
159 |
setStatusIsSet(true);
|
|
|
160 |
this.timestamp = timestamp;
|
|
|
161 |
setTimestampIsSet(true);
|
|
|
162 |
this.description = description;
|
| 4444 |
rajveer |
163 |
this.warehouseId = warehouseId;
|
|
|
164 |
setWarehouseIdIsSet(true);
|
| 305 |
ashish |
165 |
}
|
|
|
166 |
|
|
|
167 |
/**
|
|
|
168 |
* Performs a deep copy on <i>other</i>.
|
|
|
169 |
*/
|
|
|
170 |
public Alert(Alert other) {
|
|
|
171 |
__isset_bit_vector.clear();
|
|
|
172 |
__isset_bit_vector.or(other.__isset_bit_vector);
|
|
|
173 |
this.id = other.id;
|
| 4393 |
rajveer |
174 |
if (other.isSetType()) {
|
|
|
175 |
this.type = other.type;
|
| 305 |
ashish |
176 |
}
|
| 4393 |
rajveer |
177 |
this.status = other.status;
|
|
|
178 |
this.timestamp = other.timestamp;
|
|
|
179 |
if (other.isSetDescription()) {
|
|
|
180 |
this.description = other.description;
|
|
|
181 |
}
|
| 4444 |
rajveer |
182 |
this.warehouseId = other.warehouseId;
|
| 305 |
ashish |
183 |
}
|
|
|
184 |
|
|
|
185 |
public Alert deepCopy() {
|
|
|
186 |
return new Alert(this);
|
|
|
187 |
}
|
|
|
188 |
|
| 3430 |
rajveer |
189 |
@Override
|
|
|
190 |
public void clear() {
|
|
|
191 |
setIdIsSet(false);
|
|
|
192 |
this.id = 0;
|
| 4393 |
rajveer |
193 |
this.type = null;
|
|
|
194 |
setStatusIsSet(false);
|
|
|
195 |
this.status = 0;
|
|
|
196 |
setTimestampIsSet(false);
|
|
|
197 |
this.timestamp = 0;
|
|
|
198 |
this.description = null;
|
| 4444 |
rajveer |
199 |
setWarehouseIdIsSet(false);
|
|
|
200 |
this.warehouseId = 0;
|
| 305 |
ashish |
201 |
}
|
|
|
202 |
|
|
|
203 |
public long getId() {
|
|
|
204 |
return this.id;
|
|
|
205 |
}
|
|
|
206 |
|
| 3430 |
rajveer |
207 |
public void setId(long id) {
|
| 305 |
ashish |
208 |
this.id = id;
|
|
|
209 |
setIdIsSet(true);
|
|
|
210 |
}
|
|
|
211 |
|
|
|
212 |
public void unsetId() {
|
|
|
213 |
__isset_bit_vector.clear(__ID_ISSET_ID);
|
|
|
214 |
}
|
|
|
215 |
|
| 3430 |
rajveer |
216 |
/** Returns true if field id is set (has been assigned a value) and false otherwise */
|
| 305 |
ashish |
217 |
public boolean isSetId() {
|
|
|
218 |
return __isset_bit_vector.get(__ID_ISSET_ID);
|
|
|
219 |
}
|
|
|
220 |
|
|
|
221 |
public void setIdIsSet(boolean value) {
|
|
|
222 |
__isset_bit_vector.set(__ID_ISSET_ID, value);
|
|
|
223 |
}
|
|
|
224 |
|
| 4393 |
rajveer |
225 |
/**
|
|
|
226 |
*
|
|
|
227 |
* @see AlertType
|
|
|
228 |
*/
|
|
|
229 |
public AlertType getType() {
|
| 305 |
ashish |
230 |
return this.type;
|
|
|
231 |
}
|
|
|
232 |
|
| 4393 |
rajveer |
233 |
/**
|
|
|
234 |
*
|
|
|
235 |
* @see AlertType
|
|
|
236 |
*/
|
|
|
237 |
public void setType(AlertType type) {
|
| 305 |
ashish |
238 |
this.type = type;
|
|
|
239 |
}
|
|
|
240 |
|
|
|
241 |
public void unsetType() {
|
| 4393 |
rajveer |
242 |
this.type = null;
|
| 305 |
ashish |
243 |
}
|
|
|
244 |
|
| 3430 |
rajveer |
245 |
/** Returns true if field type is set (has been assigned a value) and false otherwise */
|
| 305 |
ashish |
246 |
public boolean isSetType() {
|
| 4393 |
rajveer |
247 |
return this.type != null;
|
| 305 |
ashish |
248 |
}
|
|
|
249 |
|
|
|
250 |
public void setTypeIsSet(boolean value) {
|
| 4393 |
rajveer |
251 |
if (!value) {
|
|
|
252 |
this.type = null;
|
|
|
253 |
}
|
| 305 |
ashish |
254 |
}
|
|
|
255 |
|
| 4393 |
rajveer |
256 |
public long getStatus() {
|
|
|
257 |
return this.status;
|
| 305 |
ashish |
258 |
}
|
|
|
259 |
|
| 4393 |
rajveer |
260 |
public void setStatus(long status) {
|
|
|
261 |
this.status = status;
|
|
|
262 |
setStatusIsSet(true);
|
| 305 |
ashish |
263 |
}
|
|
|
264 |
|
| 4393 |
rajveer |
265 |
public void unsetStatus() {
|
|
|
266 |
__isset_bit_vector.clear(__STATUS_ISSET_ID);
|
| 305 |
ashish |
267 |
}
|
|
|
268 |
|
| 4393 |
rajveer |
269 |
/** Returns true if field status is set (has been assigned a value) and false otherwise */
|
|
|
270 |
public boolean isSetStatus() {
|
|
|
271 |
return __isset_bit_vector.get(__STATUS_ISSET_ID);
|
| 305 |
ashish |
272 |
}
|
|
|
273 |
|
| 4393 |
rajveer |
274 |
public void setStatusIsSet(boolean value) {
|
|
|
275 |
__isset_bit_vector.set(__STATUS_ISSET_ID, value);
|
| 305 |
ashish |
276 |
}
|
|
|
277 |
|
| 4393 |
rajveer |
278 |
public long getTimestamp() {
|
|
|
279 |
return this.timestamp;
|
| 305 |
ashish |
280 |
}
|
|
|
281 |
|
| 4393 |
rajveer |
282 |
public void setTimestamp(long timestamp) {
|
|
|
283 |
this.timestamp = timestamp;
|
|
|
284 |
setTimestampIsSet(true);
|
| 305 |
ashish |
285 |
}
|
|
|
286 |
|
| 4393 |
rajveer |
287 |
public void unsetTimestamp() {
|
|
|
288 |
__isset_bit_vector.clear(__TIMESTAMP_ISSET_ID);
|
| 305 |
ashish |
289 |
}
|
|
|
290 |
|
| 4393 |
rajveer |
291 |
/** Returns true if field timestamp is set (has been assigned a value) and false otherwise */
|
|
|
292 |
public boolean isSetTimestamp() {
|
|
|
293 |
return __isset_bit_vector.get(__TIMESTAMP_ISSET_ID);
|
| 305 |
ashish |
294 |
}
|
|
|
295 |
|
| 4393 |
rajveer |
296 |
public void setTimestampIsSet(boolean value) {
|
|
|
297 |
__isset_bit_vector.set(__TIMESTAMP_ISSET_ID, value);
|
| 305 |
ashish |
298 |
}
|
|
|
299 |
|
| 4393 |
rajveer |
300 |
public String getDescription() {
|
|
|
301 |
return this.description;
|
| 305 |
ashish |
302 |
}
|
|
|
303 |
|
| 4393 |
rajveer |
304 |
public void setDescription(String description) {
|
|
|
305 |
this.description = description;
|
| 305 |
ashish |
306 |
}
|
|
|
307 |
|
| 4393 |
rajveer |
308 |
public void unsetDescription() {
|
|
|
309 |
this.description = null;
|
| 305 |
ashish |
310 |
}
|
|
|
311 |
|
| 4393 |
rajveer |
312 |
/** Returns true if field description is set (has been assigned a value) and false otherwise */
|
|
|
313 |
public boolean isSetDescription() {
|
|
|
314 |
return this.description != null;
|
| 305 |
ashish |
315 |
}
|
|
|
316 |
|
| 4393 |
rajveer |
317 |
public void setDescriptionIsSet(boolean value) {
|
|
|
318 |
if (!value) {
|
|
|
319 |
this.description = null;
|
|
|
320 |
}
|
| 305 |
ashish |
321 |
}
|
|
|
322 |
|
| 4444 |
rajveer |
323 |
public long getWarehouseId() {
|
|
|
324 |
return this.warehouseId;
|
|
|
325 |
}
|
|
|
326 |
|
|
|
327 |
public void setWarehouseId(long warehouseId) {
|
|
|
328 |
this.warehouseId = warehouseId;
|
|
|
329 |
setWarehouseIdIsSet(true);
|
|
|
330 |
}
|
|
|
331 |
|
|
|
332 |
public void unsetWarehouseId() {
|
|
|
333 |
__isset_bit_vector.clear(__WAREHOUSEID_ISSET_ID);
|
|
|
334 |
}
|
|
|
335 |
|
|
|
336 |
/** Returns true if field warehouseId is set (has been assigned a value) and false otherwise */
|
|
|
337 |
public boolean isSetWarehouseId() {
|
|
|
338 |
return __isset_bit_vector.get(__WAREHOUSEID_ISSET_ID);
|
|
|
339 |
}
|
|
|
340 |
|
|
|
341 |
public void setWarehouseIdIsSet(boolean value) {
|
|
|
342 |
__isset_bit_vector.set(__WAREHOUSEID_ISSET_ID, value);
|
|
|
343 |
}
|
|
|
344 |
|
| 305 |
ashish |
345 |
public void setFieldValue(_Fields field, Object value) {
|
|
|
346 |
switch (field) {
|
|
|
347 |
case ID:
|
|
|
348 |
if (value == null) {
|
|
|
349 |
unsetId();
|
|
|
350 |
} else {
|
|
|
351 |
setId((Long)value);
|
|
|
352 |
}
|
|
|
353 |
break;
|
|
|
354 |
|
|
|
355 |
case TYPE:
|
|
|
356 |
if (value == null) {
|
|
|
357 |
unsetType();
|
|
|
358 |
} else {
|
| 4393 |
rajveer |
359 |
setType((AlertType)value);
|
| 305 |
ashish |
360 |
}
|
|
|
361 |
break;
|
|
|
362 |
|
| 4393 |
rajveer |
363 |
case STATUS:
|
| 305 |
ashish |
364 |
if (value == null) {
|
| 4393 |
rajveer |
365 |
unsetStatus();
|
| 305 |
ashish |
366 |
} else {
|
| 4393 |
rajveer |
367 |
setStatus((Long)value);
|
| 305 |
ashish |
368 |
}
|
|
|
369 |
break;
|
|
|
370 |
|
| 4393 |
rajveer |
371 |
case TIMESTAMP:
|
| 305 |
ashish |
372 |
if (value == null) {
|
| 4393 |
rajveer |
373 |
unsetTimestamp();
|
| 305 |
ashish |
374 |
} else {
|
| 4393 |
rajveer |
375 |
setTimestamp((Long)value);
|
| 305 |
ashish |
376 |
}
|
|
|
377 |
break;
|
|
|
378 |
|
| 4393 |
rajveer |
379 |
case DESCRIPTION:
|
| 305 |
ashish |
380 |
if (value == null) {
|
| 4393 |
rajveer |
381 |
unsetDescription();
|
| 305 |
ashish |
382 |
} else {
|
| 4393 |
rajveer |
383 |
setDescription((String)value);
|
| 305 |
ashish |
384 |
}
|
|
|
385 |
break;
|
|
|
386 |
|
| 4444 |
rajveer |
387 |
case WAREHOUSE_ID:
|
|
|
388 |
if (value == null) {
|
|
|
389 |
unsetWarehouseId();
|
|
|
390 |
} else {
|
|
|
391 |
setWarehouseId((Long)value);
|
|
|
392 |
}
|
|
|
393 |
break;
|
|
|
394 |
|
| 305 |
ashish |
395 |
}
|
|
|
396 |
}
|
|
|
397 |
|
|
|
398 |
public Object getFieldValue(_Fields field) {
|
|
|
399 |
switch (field) {
|
|
|
400 |
case ID:
|
| 3430 |
rajveer |
401 |
return Long.valueOf(getId());
|
| 305 |
ashish |
402 |
|
|
|
403 |
case TYPE:
|
| 4393 |
rajveer |
404 |
return getType();
|
| 305 |
ashish |
405 |
|
| 4393 |
rajveer |
406 |
case STATUS:
|
|
|
407 |
return Long.valueOf(getStatus());
|
| 305 |
ashish |
408 |
|
| 4393 |
rajveer |
409 |
case TIMESTAMP:
|
|
|
410 |
return Long.valueOf(getTimestamp());
|
| 305 |
ashish |
411 |
|
| 4393 |
rajveer |
412 |
case DESCRIPTION:
|
|
|
413 |
return getDescription();
|
| 305 |
ashish |
414 |
|
| 4444 |
rajveer |
415 |
case WAREHOUSE_ID:
|
|
|
416 |
return Long.valueOf(getWarehouseId());
|
|
|
417 |
|
| 305 |
ashish |
418 |
}
|
|
|
419 |
throw new IllegalStateException();
|
|
|
420 |
}
|
|
|
421 |
|
| 3430 |
rajveer |
422 |
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
|
|
|
423 |
public boolean isSet(_Fields field) {
|
|
|
424 |
if (field == null) {
|
|
|
425 |
throw new IllegalArgumentException();
|
|
|
426 |
}
|
| 305 |
ashish |
427 |
|
|
|
428 |
switch (field) {
|
|
|
429 |
case ID:
|
|
|
430 |
return isSetId();
|
|
|
431 |
case TYPE:
|
|
|
432 |
return isSetType();
|
| 4393 |
rajveer |
433 |
case STATUS:
|
|
|
434 |
return isSetStatus();
|
|
|
435 |
case TIMESTAMP:
|
|
|
436 |
return isSetTimestamp();
|
|
|
437 |
case DESCRIPTION:
|
|
|
438 |
return isSetDescription();
|
| 4444 |
rajveer |
439 |
case WAREHOUSE_ID:
|
|
|
440 |
return isSetWarehouseId();
|
| 305 |
ashish |
441 |
}
|
|
|
442 |
throw new IllegalStateException();
|
|
|
443 |
}
|
|
|
444 |
|
|
|
445 |
@Override
|
|
|
446 |
public boolean equals(Object that) {
|
|
|
447 |
if (that == null)
|
|
|
448 |
return false;
|
|
|
449 |
if (that instanceof Alert)
|
|
|
450 |
return this.equals((Alert)that);
|
|
|
451 |
return false;
|
|
|
452 |
}
|
|
|
453 |
|
|
|
454 |
public boolean equals(Alert that) {
|
|
|
455 |
if (that == null)
|
|
|
456 |
return false;
|
|
|
457 |
|
|
|
458 |
boolean this_present_id = true;
|
|
|
459 |
boolean that_present_id = true;
|
|
|
460 |
if (this_present_id || that_present_id) {
|
|
|
461 |
if (!(this_present_id && that_present_id))
|
|
|
462 |
return false;
|
|
|
463 |
if (this.id != that.id)
|
|
|
464 |
return false;
|
|
|
465 |
}
|
|
|
466 |
|
| 4393 |
rajveer |
467 |
boolean this_present_type = true && this.isSetType();
|
|
|
468 |
boolean that_present_type = true && that.isSetType();
|
| 305 |
ashish |
469 |
if (this_present_type || that_present_type) {
|
|
|
470 |
if (!(this_present_type && that_present_type))
|
|
|
471 |
return false;
|
| 4393 |
rajveer |
472 |
if (!this.type.equals(that.type))
|
| 305 |
ashish |
473 |
return false;
|
|
|
474 |
}
|
|
|
475 |
|
| 4393 |
rajveer |
476 |
boolean this_present_status = true;
|
|
|
477 |
boolean that_present_status = true;
|
|
|
478 |
if (this_present_status || that_present_status) {
|
|
|
479 |
if (!(this_present_status && that_present_status))
|
| 305 |
ashish |
480 |
return false;
|
| 4393 |
rajveer |
481 |
if (this.status != that.status)
|
| 305 |
ashish |
482 |
return false;
|
|
|
483 |
}
|
|
|
484 |
|
| 4393 |
rajveer |
485 |
boolean this_present_timestamp = true;
|
|
|
486 |
boolean that_present_timestamp = true;
|
|
|
487 |
if (this_present_timestamp || that_present_timestamp) {
|
|
|
488 |
if (!(this_present_timestamp && that_present_timestamp))
|
| 305 |
ashish |
489 |
return false;
|
| 4393 |
rajveer |
490 |
if (this.timestamp != that.timestamp)
|
| 305 |
ashish |
491 |
return false;
|
|
|
492 |
}
|
|
|
493 |
|
| 4393 |
rajveer |
494 |
boolean this_present_description = true && this.isSetDescription();
|
|
|
495 |
boolean that_present_description = true && that.isSetDescription();
|
|
|
496 |
if (this_present_description || that_present_description) {
|
|
|
497 |
if (!(this_present_description && that_present_description))
|
| 305 |
ashish |
498 |
return false;
|
| 4393 |
rajveer |
499 |
if (!this.description.equals(that.description))
|
| 305 |
ashish |
500 |
return false;
|
|
|
501 |
}
|
|
|
502 |
|
| 4444 |
rajveer |
503 |
boolean this_present_warehouseId = true;
|
|
|
504 |
boolean that_present_warehouseId = true;
|
|
|
505 |
if (this_present_warehouseId || that_present_warehouseId) {
|
|
|
506 |
if (!(this_present_warehouseId && that_present_warehouseId))
|
|
|
507 |
return false;
|
|
|
508 |
if (this.warehouseId != that.warehouseId)
|
|
|
509 |
return false;
|
|
|
510 |
}
|
|
|
511 |
|
| 305 |
ashish |
512 |
return true;
|
|
|
513 |
}
|
|
|
514 |
|
|
|
515 |
@Override
|
|
|
516 |
public int hashCode() {
|
|
|
517 |
return 0;
|
|
|
518 |
}
|
|
|
519 |
|
|
|
520 |
public int compareTo(Alert other) {
|
|
|
521 |
if (!getClass().equals(other.getClass())) {
|
|
|
522 |
return getClass().getName().compareTo(other.getClass().getName());
|
|
|
523 |
}
|
|
|
524 |
|
|
|
525 |
int lastComparison = 0;
|
|
|
526 |
Alert typedOther = (Alert)other;
|
|
|
527 |
|
| 3430 |
rajveer |
528 |
lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
|
| 305 |
ashish |
529 |
if (lastComparison != 0) {
|
|
|
530 |
return lastComparison;
|
|
|
531 |
}
|
| 3430 |
rajveer |
532 |
if (isSetId()) {
|
|
|
533 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
|
|
|
534 |
if (lastComparison != 0) {
|
|
|
535 |
return lastComparison;
|
|
|
536 |
}
|
| 305 |
ashish |
537 |
}
|
| 3430 |
rajveer |
538 |
lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
|
| 305 |
ashish |
539 |
if (lastComparison != 0) {
|
|
|
540 |
return lastComparison;
|
|
|
541 |
}
|
| 3430 |
rajveer |
542 |
if (isSetType()) {
|
|
|
543 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
|
|
|
544 |
if (lastComparison != 0) {
|
|
|
545 |
return lastComparison;
|
|
|
546 |
}
|
| 305 |
ashish |
547 |
}
|
| 4393 |
rajveer |
548 |
lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
|
| 305 |
ashish |
549 |
if (lastComparison != 0) {
|
|
|
550 |
return lastComparison;
|
|
|
551 |
}
|
| 4393 |
rajveer |
552 |
if (isSetStatus()) {
|
|
|
553 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
|
| 3430 |
rajveer |
554 |
if (lastComparison != 0) {
|
|
|
555 |
return lastComparison;
|
|
|
556 |
}
|
| 305 |
ashish |
557 |
}
|
| 4393 |
rajveer |
558 |
lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(typedOther.isSetTimestamp());
|
| 305 |
ashish |
559 |
if (lastComparison != 0) {
|
|
|
560 |
return lastComparison;
|
|
|
561 |
}
|
| 4393 |
rajveer |
562 |
if (isSetTimestamp()) {
|
|
|
563 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, typedOther.timestamp);
|
| 3430 |
rajveer |
564 |
if (lastComparison != 0) {
|
|
|
565 |
return lastComparison;
|
|
|
566 |
}
|
| 305 |
ashish |
567 |
}
|
| 4393 |
rajveer |
568 |
lastComparison = Boolean.valueOf(isSetDescription()).compareTo(typedOther.isSetDescription());
|
| 305 |
ashish |
569 |
if (lastComparison != 0) {
|
|
|
570 |
return lastComparison;
|
|
|
571 |
}
|
| 4393 |
rajveer |
572 |
if (isSetDescription()) {
|
|
|
573 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, typedOther.description);
|
| 3430 |
rajveer |
574 |
if (lastComparison != 0) {
|
|
|
575 |
return lastComparison;
|
|
|
576 |
}
|
| 305 |
ashish |
577 |
}
|
| 4444 |
rajveer |
578 |
lastComparison = Boolean.valueOf(isSetWarehouseId()).compareTo(typedOther.isSetWarehouseId());
|
|
|
579 |
if (lastComparison != 0) {
|
|
|
580 |
return lastComparison;
|
|
|
581 |
}
|
|
|
582 |
if (isSetWarehouseId()) {
|
|
|
583 |
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warehouseId, typedOther.warehouseId);
|
|
|
584 |
if (lastComparison != 0) {
|
|
|
585 |
return lastComparison;
|
|
|
586 |
}
|
|
|
587 |
}
|
| 305 |
ashish |
588 |
return 0;
|
|
|
589 |
}
|
|
|
590 |
|
| 3430 |
rajveer |
591 |
public _Fields fieldForId(int fieldId) {
|
|
|
592 |
return _Fields.findByThriftId(fieldId);
|
|
|
593 |
}
|
|
|
594 |
|
|
|
595 |
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
|
|
|
596 |
org.apache.thrift.protocol.TField field;
|
| 305 |
ashish |
597 |
iprot.readStructBegin();
|
|
|
598 |
while (true)
|
|
|
599 |
{
|
|
|
600 |
field = iprot.readFieldBegin();
|
| 3430 |
rajveer |
601 |
if (field.type == org.apache.thrift.protocol.TType.STOP) {
|
| 305 |
ashish |
602 |
break;
|
|
|
603 |
}
|
| 3430 |
rajveer |
604 |
switch (field.id) {
|
|
|
605 |
case 1: // ID
|
|
|
606 |
if (field.type == org.apache.thrift.protocol.TType.I64) {
|
|
|
607 |
this.id = iprot.readI64();
|
|
|
608 |
setIdIsSet(true);
|
|
|
609 |
} else {
|
|
|
610 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
611 |
}
|
|
|
612 |
break;
|
| 4393 |
rajveer |
613 |
case 2: // TYPE
|
|
|
614 |
if (field.type == org.apache.thrift.protocol.TType.I32) {
|
|
|
615 |
this.type = AlertType.findByValue(iprot.readI32());
|
| 3430 |
rajveer |
616 |
} else {
|
|
|
617 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
618 |
}
|
|
|
619 |
break;
|
| 4393 |
rajveer |
620 |
case 3: // STATUS
|
| 3430 |
rajveer |
621 |
if (field.type == org.apache.thrift.protocol.TType.I64) {
|
| 4393 |
rajveer |
622 |
this.status = iprot.readI64();
|
|
|
623 |
setStatusIsSet(true);
|
| 3430 |
rajveer |
624 |
} else {
|
|
|
625 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
626 |
}
|
|
|
627 |
break;
|
| 4393 |
rajveer |
628 |
case 4: // TIMESTAMP
|
| 3430 |
rajveer |
629 |
if (field.type == org.apache.thrift.protocol.TType.I64) {
|
| 4393 |
rajveer |
630 |
this.timestamp = iprot.readI64();
|
|
|
631 |
setTimestampIsSet(true);
|
| 3430 |
rajveer |
632 |
} else {
|
|
|
633 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
634 |
}
|
|
|
635 |
break;
|
| 4393 |
rajveer |
636 |
case 5: // DESCRIPTION
|
| 3430 |
rajveer |
637 |
if (field.type == org.apache.thrift.protocol.TType.STRING) {
|
| 4393 |
rajveer |
638 |
this.description = iprot.readString();
|
| 3430 |
rajveer |
639 |
} else {
|
|
|
640 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
641 |
}
|
|
|
642 |
break;
|
| 4444 |
rajveer |
643 |
case 6: // WAREHOUSE_ID
|
|
|
644 |
if (field.type == org.apache.thrift.protocol.TType.I64) {
|
|
|
645 |
this.warehouseId = iprot.readI64();
|
|
|
646 |
setWarehouseIdIsSet(true);
|
|
|
647 |
} else {
|
|
|
648 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
|
|
649 |
}
|
|
|
650 |
break;
|
| 3430 |
rajveer |
651 |
default:
|
|
|
652 |
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
|
| 305 |
ashish |
653 |
}
|
| 3430 |
rajveer |
654 |
iprot.readFieldEnd();
|
| 305 |
ashish |
655 |
}
|
|
|
656 |
iprot.readStructEnd();
|
|
|
657 |
validate();
|
|
|
658 |
}
|
|
|
659 |
|
| 3430 |
rajveer |
660 |
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
|
| 305 |
ashish |
661 |
validate();
|
|
|
662 |
|
|
|
663 |
oprot.writeStructBegin(STRUCT_DESC);
|
|
|
664 |
oprot.writeFieldBegin(ID_FIELD_DESC);
|
|
|
665 |
oprot.writeI64(this.id);
|
|
|
666 |
oprot.writeFieldEnd();
|
| 4393 |
rajveer |
667 |
if (this.type != null) {
|
|
|
668 |
oprot.writeFieldBegin(TYPE_FIELD_DESC);
|
|
|
669 |
oprot.writeI32(this.type.getValue());
|
|
|
670 |
oprot.writeFieldEnd();
|
|
|
671 |
}
|
|
|
672 |
oprot.writeFieldBegin(STATUS_FIELD_DESC);
|
|
|
673 |
oprot.writeI64(this.status);
|
| 305 |
ashish |
674 |
oprot.writeFieldEnd();
|
| 4393 |
rajveer |
675 |
oprot.writeFieldBegin(TIMESTAMP_FIELD_DESC);
|
|
|
676 |
oprot.writeI64(this.timestamp);
|
| 305 |
ashish |
677 |
oprot.writeFieldEnd();
|
| 4393 |
rajveer |
678 |
if (this.description != null) {
|
|
|
679 |
oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
|
|
|
680 |
oprot.writeString(this.description);
|
| 305 |
ashish |
681 |
oprot.writeFieldEnd();
|
|
|
682 |
}
|
| 4444 |
rajveer |
683 |
oprot.writeFieldBegin(WAREHOUSE_ID_FIELD_DESC);
|
|
|
684 |
oprot.writeI64(this.warehouseId);
|
|
|
685 |
oprot.writeFieldEnd();
|
| 305 |
ashish |
686 |
oprot.writeFieldStop();
|
|
|
687 |
oprot.writeStructEnd();
|
|
|
688 |
}
|
|
|
689 |
|
|
|
690 |
@Override
|
|
|
691 |
public String toString() {
|
|
|
692 |
StringBuilder sb = new StringBuilder("Alert(");
|
|
|
693 |
boolean first = true;
|
|
|
694 |
|
|
|
695 |
sb.append("id:");
|
|
|
696 |
sb.append(this.id);
|
|
|
697 |
first = false;
|
|
|
698 |
if (!first) sb.append(", ");
|
| 4393 |
rajveer |
699 |
sb.append("type:");
|
|
|
700 |
if (this.type == null) {
|
|
|
701 |
sb.append("null");
|
|
|
702 |
} else {
|
|
|
703 |
sb.append(this.type);
|
|
|
704 |
}
|
| 305 |
ashish |
705 |
first = false;
|
|
|
706 |
if (!first) sb.append(", ");
|
| 4393 |
rajveer |
707 |
sb.append("status:");
|
|
|
708 |
sb.append(this.status);
|
| 305 |
ashish |
709 |
first = false;
|
|
|
710 |
if (!first) sb.append(", ");
|
| 4393 |
rajveer |
711 |
sb.append("timestamp:");
|
|
|
712 |
sb.append(this.timestamp);
|
| 305 |
ashish |
713 |
first = false;
|
|
|
714 |
if (!first) sb.append(", ");
|
| 4393 |
rajveer |
715 |
sb.append("description:");
|
|
|
716 |
if (this.description == null) {
|
| 305 |
ashish |
717 |
sb.append("null");
|
|
|
718 |
} else {
|
| 4393 |
rajveer |
719 |
sb.append(this.description);
|
| 305 |
ashish |
720 |
}
|
|
|
721 |
first = false;
|
| 4444 |
rajveer |
722 |
if (!first) sb.append(", ");
|
|
|
723 |
sb.append("warehouseId:");
|
|
|
724 |
sb.append(this.warehouseId);
|
|
|
725 |
first = false;
|
| 305 |
ashish |
726 |
sb.append(")");
|
|
|
727 |
return sb.toString();
|
|
|
728 |
}
|
|
|
729 |
|
| 3430 |
rajveer |
730 |
public void validate() throws org.apache.thrift.TException {
|
| 305 |
ashish |
731 |
// check for required fields
|
|
|
732 |
}
|
|
|
733 |
|
| 3430 |
rajveer |
734 |
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
|
|
|
735 |
try {
|
|
|
736 |
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
|
|
|
737 |
} catch (org.apache.thrift.TException te) {
|
|
|
738 |
throw new java.io.IOException(te);
|
|
|
739 |
}
|
|
|
740 |
}
|
|
|
741 |
|
|
|
742 |
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
|
|
|
743 |
try {
|
|
|
744 |
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
|
|
|
745 |
__isset_bit_vector = new BitSet(1);
|
|
|
746 |
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
|
|
|
747 |
} catch (org.apache.thrift.TException te) {
|
|
|
748 |
throw new java.io.IOException(te);
|
|
|
749 |
}
|
|
|
750 |
}
|
|
|
751 |
|
| 305 |
ashish |
752 |
}
|
|
|
753 |
|