SENTRY-2192: supress date value in @Generated annotation generated by thrift.(Kalyan...
[sentry.git] / sentry-hdfs / sentry-hdfs-common / src / gen / thrift / gen-javabean / org / apache / sentry / hdfs / service / thrift / TRoleChanges.java
1 /**
2 * Autogenerated by Thrift Compiler (0.9.3)
3 *
4 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 * @generated
6 */
7 package org.apache.sentry.hdfs.service.thrift;
8
9 import org.apache.thrift.scheme.IScheme;
10 import org.apache.thrift.scheme.SchemeFactory;
11 import org.apache.thrift.scheme.StandardScheme;
12
13 import org.apache.thrift.scheme.TupleScheme;
14 import org.apache.thrift.protocol.TTupleProtocol;
15 import org.apache.thrift.protocol.TProtocolException;
16 import org.apache.thrift.EncodingUtils;
17 import org.apache.thrift.TException;
18 import org.apache.thrift.async.AsyncMethodCallback;
19 import org.apache.thrift.server.AbstractNonblockingServer.*;
20 import java.util.List;
21 import java.util.ArrayList;
22 import java.util.Map;
23 import java.util.HashMap;
24 import java.util.EnumMap;
25 import java.util.Set;
26 import java.util.HashSet;
27 import java.util.EnumSet;
28 import java.util.Collections;
29 import java.util.BitSet;
30 import java.nio.ByteBuffer;
31 import java.util.Arrays;
32 import javax.annotation.Generated;
33 import org.slf4j.Logger;
34 import org.slf4j.LoggerFactory;
35
36 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
37 @Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
38 public class TRoleChanges implements org.apache.thrift.TBase<TRoleChanges, TRoleChanges._Fields>, java.io.Serializable, Cloneable, Comparable<TRoleChanges> {
39 private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRoleChanges");
40
41 private static final org.apache.thrift.protocol.TField ROLE_FIELD_DESC = new org.apache.thrift.protocol.TField("role", org.apache.thrift.protocol.TType.STRING, (short)1);
42 private static final org.apache.thrift.protocol.TField ADD_GROUPS_FIELD_DESC = new org.apache.thrift.protocol.TField("addGroups", org.apache.thrift.protocol.TType.LIST, (short)2);
43 private static final org.apache.thrift.protocol.TField DEL_GROUPS_FIELD_DESC = new org.apache.thrift.protocol.TField("delGroups", org.apache.thrift.protocol.TType.LIST, (short)3);
44
45 private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
46 static {
47 schemes.put(StandardScheme.class, new TRoleChangesStandardSchemeFactory());
48 schemes.put(TupleScheme.class, new TRoleChangesTupleSchemeFactory());
49 }
50
51 private String role; // required
52 private List<String> addGroups; // required
53 private List<String> delGroups; // required
54
55 /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
56 public enum _Fields implements org.apache.thrift.TFieldIdEnum {
57 ROLE((short)1, "role"),
58 ADD_GROUPS((short)2, "addGroups"),
59 DEL_GROUPS((short)3, "delGroups");
60
61 private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
62
63 static {
64 for (_Fields field : EnumSet.allOf(_Fields.class)) {
65 byName.put(field.getFieldName(), field);
66 }
67 }
68
69 /**
70 * Find the _Fields constant that matches fieldId, or null if its not found.
71 */
72 public static _Fields findByThriftId(int fieldId) {
73 switch(fieldId) {
74 case 1: // ROLE
75 return ROLE;
76 case 2: // ADD_GROUPS
77 return ADD_GROUPS;
78 case 3: // DEL_GROUPS
79 return DEL_GROUPS;
80 default:
81 return null;
82 }
83 }
84
85 /**
86 * Find the _Fields constant that matches fieldId, throwing an exception
87 * if it is not found.
88 */
89 public static _Fields findByThriftIdOrThrow(int fieldId) {
90 _Fields fields = findByThriftId(fieldId);
91 if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
92 return fields;
93 }
94
95 /**
96 * Find the _Fields constant that matches name, or null if its not found.
97 */
98 public static _Fields findByName(String name) {
99 return byName.get(name);
100 }
101
102 private final short _thriftId;
103 private final String _fieldName;
104
105 _Fields(short thriftId, String fieldName) {
106 _thriftId = thriftId;
107 _fieldName = fieldName;
108 }
109
110 public short getThriftFieldId() {
111 return _thriftId;
112 }
113
114 public String getFieldName() {
115 return _fieldName;
116 }
117 }
118
119 // isset id assignments
120 public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
121 static {
122 Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
123 tmpMap.put(_Fields.ROLE, new org.apache.thrift.meta_data.FieldMetaData("role", org.apache.thrift.TFieldRequirementType.REQUIRED,
124 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
125 tmpMap.put(_Fields.ADD_GROUPS, new org.apache.thrift.meta_data.FieldMetaData("addGroups", org.apache.thrift.TFieldRequirementType.REQUIRED,
126 new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
127 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
128 tmpMap.put(_Fields.DEL_GROUPS, new org.apache.thrift.meta_data.FieldMetaData("delGroups", org.apache.thrift.TFieldRequirementType.REQUIRED,
129 new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
130 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
131 metaDataMap = Collections.unmodifiableMap(tmpMap);
132 org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRoleChanges.class, metaDataMap);
133 }
134
135 public TRoleChanges() {
136 }
137
138 public TRoleChanges(
139 String role,
140 List<String> addGroups,
141 List<String> delGroups)
142 {
143 this();
144 this.role = role;
145 this.addGroups = addGroups;
146 this.delGroups = delGroups;
147 }
148
149 /**
150 * Performs a deep copy on <i>other</i>.
151 */
152 public TRoleChanges(TRoleChanges other) {
153 if (other.isSetRole()) {
154 this.role = other.role;
155 }
156 if (other.isSetAddGroups()) {
157 List<String> __this__addGroups = new ArrayList<String>(other.addGroups);
158 this.addGroups = __this__addGroups;
159 }
160 if (other.isSetDelGroups()) {
161 List<String> __this__delGroups = new ArrayList<String>(other.delGroups);
162 this.delGroups = __this__delGroups;
163 }
164 }
165
166 public TRoleChanges deepCopy() {
167 return new TRoleChanges(this);
168 }
169
170 @Override
171 public void clear() {
172 this.role = null;
173 this.addGroups = null;
174 this.delGroups = null;
175 }
176
177 public String getRole() {
178 return this.role;
179 }
180
181 public void setRole(String role) {
182 this.role = role;
183 }
184
185 public void unsetRole() {
186 this.role = null;
187 }
188
189 /** Returns true if field role is set (has been assigned a value) and false otherwise */
190 public boolean isSetRole() {
191 return this.role != null;
192 }
193
194 public void setRoleIsSet(boolean value) {
195 if (!value) {
196 this.role = null;
197 }
198 }
199
200 public int getAddGroupsSize() {
201 return (this.addGroups == null) ? 0 : this.addGroups.size();
202 }
203
204 public java.util.Iterator<String> getAddGroupsIterator() {
205 return (this.addGroups == null) ? null : this.addGroups.iterator();
206 }
207
208 public void addToAddGroups(String elem) {
209 if (this.addGroups == null) {
210 this.addGroups = new ArrayList<String>();
211 }
212 this.addGroups.add(elem);
213 }
214
215 public List<String> getAddGroups() {
216 return this.addGroups;
217 }
218
219 public void setAddGroups(List<String> addGroups) {
220 this.addGroups = addGroups;
221 }
222
223 public void unsetAddGroups() {
224 this.addGroups = null;
225 }
226
227 /** Returns true if field addGroups is set (has been assigned a value) and false otherwise */
228 public boolean isSetAddGroups() {
229 return this.addGroups != null;
230 }
231
232 public void setAddGroupsIsSet(boolean value) {
233 if (!value) {
234 this.addGroups = null;
235 }
236 }
237
238 public int getDelGroupsSize() {
239 return (this.delGroups == null) ? 0 : this.delGroups.size();
240 }
241
242 public java.util.Iterator<String> getDelGroupsIterator() {
243 return (this.delGroups == null) ? null : this.delGroups.iterator();
244 }
245
246 public void addToDelGroups(String elem) {
247 if (this.delGroups == null) {
248 this.delGroups = new ArrayList<String>();
249 }
250 this.delGroups.add(elem);
251 }
252
253 public List<String> getDelGroups() {
254 return this.delGroups;
255 }
256
257 public void setDelGroups(List<String> delGroups) {
258 this.delGroups = delGroups;
259 }
260
261 public void unsetDelGroups() {
262 this.delGroups = null;
263 }
264
265 /** Returns true if field delGroups is set (has been assigned a value) and false otherwise */
266 public boolean isSetDelGroups() {
267 return this.delGroups != null;
268 }
269
270 public void setDelGroupsIsSet(boolean value) {
271 if (!value) {
272 this.delGroups = null;
273 }
274 }
275
276 public void setFieldValue(_Fields field, Object value) {
277 switch (field) {
278 case ROLE:
279 if (value == null) {
280 unsetRole();
281 } else {
282 setRole((String)value);
283 }
284 break;
285
286 case ADD_GROUPS:
287 if (value == null) {
288 unsetAddGroups();
289 } else {
290 setAddGroups((List<String>)value);
291 }
292 break;
293
294 case DEL_GROUPS:
295 if (value == null) {
296 unsetDelGroups();
297 } else {
298 setDelGroups((List<String>)value);
299 }
300 break;
301
302 }
303 }
304
305 public Object getFieldValue(_Fields field) {
306 switch (field) {
307 case ROLE:
308 return getRole();
309
310 case ADD_GROUPS:
311 return getAddGroups();
312
313 case DEL_GROUPS:
314 return getDelGroups();
315
316 }
317 throw new IllegalStateException();
318 }
319
320 /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
321 public boolean isSet(_Fields field) {
322 if (field == null) {
323 throw new IllegalArgumentException();
324 }
325
326 switch (field) {
327 case ROLE:
328 return isSetRole();
329 case ADD_GROUPS:
330 return isSetAddGroups();
331 case DEL_GROUPS:
332 return isSetDelGroups();
333 }
334 throw new IllegalStateException();
335 }
336
337 @Override
338 public boolean equals(Object that) {
339 if (that == null)
340 return false;
341 if (that instanceof TRoleChanges)
342 return this.equals((TRoleChanges)that);
343 return false;
344 }
345
346 public boolean equals(TRoleChanges that) {
347 if (that == null)
348 return false;
349
350 boolean this_present_role = true && this.isSetRole();
351 boolean that_present_role = true && that.isSetRole();
352 if (this_present_role || that_present_role) {
353 if (!(this_present_role && that_present_role))
354 return false;
355 if (!this.role.equals(that.role))
356 return false;
357 }
358
359 boolean this_present_addGroups = true && this.isSetAddGroups();
360 boolean that_present_addGroups = true && that.isSetAddGroups();
361 if (this_present_addGroups || that_present_addGroups) {
362 if (!(this_present_addGroups && that_present_addGroups))
363 return false;
364 if (!this.addGroups.equals(that.addGroups))
365 return false;
366 }
367
368 boolean this_present_delGroups = true && this.isSetDelGroups();
369 boolean that_present_delGroups = true && that.isSetDelGroups();
370 if (this_present_delGroups || that_present_delGroups) {
371 if (!(this_present_delGroups && that_present_delGroups))
372 return false;
373 if (!this.delGroups.equals(that.delGroups))
374 return false;
375 }
376
377 return true;
378 }
379
380 @Override
381 public int hashCode() {
382 List<Object> list = new ArrayList<Object>();
383
384 boolean present_role = true && (isSetRole());
385 list.add(present_role);
386 if (present_role)
387 list.add(role);
388
389 boolean present_addGroups = true && (isSetAddGroups());
390 list.add(present_addGroups);
391 if (present_addGroups)
392 list.add(addGroups);
393
394 boolean present_delGroups = true && (isSetDelGroups());
395 list.add(present_delGroups);
396 if (present_delGroups)
397 list.add(delGroups);
398
399 return list.hashCode();
400 }
401
402 @Override
403 public int compareTo(TRoleChanges other) {
404 if (!getClass().equals(other.getClass())) {
405 return getClass().getName().compareTo(other.getClass().getName());
406 }
407
408 int lastComparison = 0;
409
410 lastComparison = Boolean.valueOf(isSetRole()).compareTo(other.isSetRole());
411 if (lastComparison != 0) {
412 return lastComparison;
413 }
414 if (isSetRole()) {
415 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.role, other.role);
416 if (lastComparison != 0) {
417 return lastComparison;
418 }
419 }
420 lastComparison = Boolean.valueOf(isSetAddGroups()).compareTo(other.isSetAddGroups());
421 if (lastComparison != 0) {
422 return lastComparison;
423 }
424 if (isSetAddGroups()) {
425 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.addGroups, other.addGroups);
426 if (lastComparison != 0) {
427 return lastComparison;
428 }
429 }
430 lastComparison = Boolean.valueOf(isSetDelGroups()).compareTo(other.isSetDelGroups());
431 if (lastComparison != 0) {
432 return lastComparison;
433 }
434 if (isSetDelGroups()) {
435 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delGroups, other.delGroups);
436 if (lastComparison != 0) {
437 return lastComparison;
438 }
439 }
440 return 0;
441 }
442
443 public _Fields fieldForId(int fieldId) {
444 return _Fields.findByThriftId(fieldId);
445 }
446
447 public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
448 schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
449 }
450
451 public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
452 schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
453 }
454
455 @Override
456 public String toString() {
457 StringBuilder sb = new StringBuilder("TRoleChanges(");
458 boolean first = true;
459
460 sb.append("role:");
461 if (this.role == null) {
462 sb.append("null");
463 } else {
464 sb.append(this.role);
465 }
466 first = false;
467 if (!first) sb.append(", ");
468 sb.append("addGroups:");
469 if (this.addGroups == null) {
470 sb.append("null");
471 } else {
472 sb.append(this.addGroups);
473 }
474 first = false;
475 if (!first) sb.append(", ");
476 sb.append("delGroups:");
477 if (this.delGroups == null) {
478 sb.append("null");
479 } else {
480 sb.append(this.delGroups);
481 }
482 first = false;
483 sb.append(")");
484 return sb.toString();
485 }
486
487 public void validate() throws org.apache.thrift.TException {
488 // check for required fields
489 if (!isSetRole()) {
490 throw new org.apache.thrift.protocol.TProtocolException("Required field 'role' is unset! Struct:" + toString());
491 }
492
493 if (!isSetAddGroups()) {
494 throw new org.apache.thrift.protocol.TProtocolException("Required field 'addGroups' is unset! Struct:" + toString());
495 }
496
497 if (!isSetDelGroups()) {
498 throw new org.apache.thrift.protocol.TProtocolException("Required field 'delGroups' is unset! Struct:" + toString());
499 }
500
501 // check for sub-struct validity
502 }
503
504 private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
505 try {
506 write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
507 } catch (org.apache.thrift.TException te) {
508 throw new java.io.IOException(te);
509 }
510 }
511
512 private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
513 try {
514 read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
515 } catch (org.apache.thrift.TException te) {
516 throw new java.io.IOException(te);
517 }
518 }
519
520 private static class TRoleChangesStandardSchemeFactory implements SchemeFactory {
521 public TRoleChangesStandardScheme getScheme() {
522 return new TRoleChangesStandardScheme();
523 }
524 }
525
526 private static class TRoleChangesStandardScheme extends StandardScheme<TRoleChanges> {
527
528 public void read(org.apache.thrift.protocol.TProtocol iprot, TRoleChanges struct) throws org.apache.thrift.TException {
529 org.apache.thrift.protocol.TField schemeField;
530 iprot.readStructBegin();
531 while (true)
532 {
533 schemeField = iprot.readFieldBegin();
534 if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
535 break;
536 }
537 switch (schemeField.id) {
538 case 1: // ROLE
539 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
540 struct.role = iprot.readString();
541 struct.setRoleIsSet(true);
542 } else {
543 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
544 }
545 break;
546 case 2: // ADD_GROUPS
547 if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
548 {
549 org.apache.thrift.protocol.TList _list94 = iprot.readListBegin();
550 struct.addGroups = new ArrayList<String>(_list94.size);
551 String _elem95;
552 for (int _i96 = 0; _i96 < _list94.size; ++_i96)
553 {
554 _elem95 = iprot.readString();
555 struct.addGroups.add(_elem95);
556 }
557 iprot.readListEnd();
558 }
559 struct.setAddGroupsIsSet(true);
560 } else {
561 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
562 }
563 break;
564 case 3: // DEL_GROUPS
565 if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
566 {
567 org.apache.thrift.protocol.TList _list97 = iprot.readListBegin();
568 struct.delGroups = new ArrayList<String>(_list97.size);
569 String _elem98;
570 for (int _i99 = 0; _i99 < _list97.size; ++_i99)
571 {
572 _elem98 = iprot.readString();
573 struct.delGroups.add(_elem98);
574 }
575 iprot.readListEnd();
576 }
577 struct.setDelGroupsIsSet(true);
578 } else {
579 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
580 }
581 break;
582 default:
583 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
584 }
585 iprot.readFieldEnd();
586 }
587 iprot.readStructEnd();
588 struct.validate();
589 }
590
591 public void write(org.apache.thrift.protocol.TProtocol oprot, TRoleChanges struct) throws org.apache.thrift.TException {
592 struct.validate();
593
594 oprot.writeStructBegin(STRUCT_DESC);
595 if (struct.role != null) {
596 oprot.writeFieldBegin(ROLE_FIELD_DESC);
597 oprot.writeString(struct.role);
598 oprot.writeFieldEnd();
599 }
600 if (struct.addGroups != null) {
601 oprot.writeFieldBegin(ADD_GROUPS_FIELD_DESC);
602 {
603 oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.addGroups.size()));
604 for (String _iter100 : struct.addGroups)
605 {
606 oprot.writeString(_iter100);
607 }
608 oprot.writeListEnd();
609 }
610 oprot.writeFieldEnd();
611 }
612 if (struct.delGroups != null) {
613 oprot.writeFieldBegin(DEL_GROUPS_FIELD_DESC);
614 {
615 oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.delGroups.size()));
616 for (String _iter101 : struct.delGroups)
617 {
618 oprot.writeString(_iter101);
619 }
620 oprot.writeListEnd();
621 }
622 oprot.writeFieldEnd();
623 }
624 oprot.writeFieldStop();
625 oprot.writeStructEnd();
626 }
627
628 }
629
630 private static class TRoleChangesTupleSchemeFactory implements SchemeFactory {
631 public TRoleChangesTupleScheme getScheme() {
632 return new TRoleChangesTupleScheme();
633 }
634 }
635
636 private static class TRoleChangesTupleScheme extends TupleScheme<TRoleChanges> {
637
638 @Override
639 public void write(org.apache.thrift.protocol.TProtocol prot, TRoleChanges struct) throws org.apache.thrift.TException {
640 TTupleProtocol oprot = (TTupleProtocol) prot;
641 oprot.writeString(struct.role);
642 {
643 oprot.writeI32(struct.addGroups.size());
644 for (String _iter102 : struct.addGroups)
645 {
646 oprot.writeString(_iter102);
647 }
648 }
649 {
650 oprot.writeI32(struct.delGroups.size());
651 for (String _iter103 : struct.delGroups)
652 {
653 oprot.writeString(_iter103);
654 }
655 }
656 }
657
658 @Override
659 public void read(org.apache.thrift.protocol.TProtocol prot, TRoleChanges struct) throws org.apache.thrift.TException {
660 TTupleProtocol iprot = (TTupleProtocol) prot;
661 struct.role = iprot.readString();
662 struct.setRoleIsSet(true);
663 {
664 org.apache.thrift.protocol.TList _list104 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
665 struct.addGroups = new ArrayList<String>(_list104.size);
666 String _elem105;
667 for (int _i106 = 0; _i106 < _list104.size; ++_i106)
668 {
669 _elem105 = iprot.readString();
670 struct.addGroups.add(_elem105);
671 }
672 }
673 struct.setAddGroupsIsSet(true);
674 {
675 org.apache.thrift.protocol.TList _list107 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
676 struct.delGroups = new ArrayList<String>(_list107.size);
677 String _elem108;
678 for (int _i109 = 0; _i109 < _list107.size; ++_i109)
679 {
680 _elem108 = iprot.readString();
681 struct.delGroups.add(_elem108);
682 }
683 }
684 struct.setDelGroupsIsSet(true);
685 }
686 }
687
688 }
689