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