SENTRY-2192: supress date value in @Generated annotation generated by thrift.(Kalyan...
[sentry.git] / sentry-provider / sentry-provider-db / src / gen / thrift / gen-javabean / org / apache / sentry / provider / db / service / thrift / TAlterSentryRoleAddUsersRequest.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.provider.db.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 TAlterSentryRoleAddUsersRequest implements org.apache.thrift.TBase<TAlterSentryRoleAddUsersRequest, TAlterSentryRoleAddUsersRequest._Fields>, java.io.Serializable, Cloneable, Comparable<TAlterSentryRoleAddUsersRequest> {
39 private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TAlterSentryRoleAddUsersRequest");
40
41 private static final org.apache.thrift.protocol.TField PROTOCOL_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("protocol_version", org.apache.thrift.protocol.TType.I32, (short)1);
42 private static final org.apache.thrift.protocol.TField REQUESTOR_USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("requestorUserName", org.apache.thrift.protocol.TType.STRING, (short)2);
43 private static final org.apache.thrift.protocol.TField ROLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("roleName", org.apache.thrift.protocol.TType.STRING, (short)3);
44 private static final org.apache.thrift.protocol.TField USERS_FIELD_DESC = new org.apache.thrift.protocol.TField("users", org.apache.thrift.protocol.TType.SET, (short)4);
45
46 private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
47 static {
48 schemes.put(StandardScheme.class, new TAlterSentryRoleAddUsersRequestStandardSchemeFactory());
49 schemes.put(TupleScheme.class, new TAlterSentryRoleAddUsersRequestTupleSchemeFactory());
50 }
51
52 private int protocol_version; // required
53 private String requestorUserName; // required
54 private String roleName; // required
55 private Set<String> users; // required
56
57 /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
58 public enum _Fields implements org.apache.thrift.TFieldIdEnum {
59 PROTOCOL_VERSION((short)1, "protocol_version"),
60 REQUESTOR_USER_NAME((short)2, "requestorUserName"),
61 ROLE_NAME((short)3, "roleName"),
62 USERS((short)4, "users");
63
64 private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
65
66 static {
67 for (_Fields field : EnumSet.allOf(_Fields.class)) {
68 byName.put(field.getFieldName(), field);
69 }
70 }
71
72 /**
73 * Find the _Fields constant that matches fieldId, or null if its not found.
74 */
75 public static _Fields findByThriftId(int fieldId) {
76 switch(fieldId) {
77 case 1: // PROTOCOL_VERSION
78 return PROTOCOL_VERSION;
79 case 2: // REQUESTOR_USER_NAME
80 return REQUESTOR_USER_NAME;
81 case 3: // ROLE_NAME
82 return ROLE_NAME;
83 case 4: // USERS
84 return USERS;
85 default:
86 return null;
87 }
88 }
89
90 /**
91 * Find the _Fields constant that matches fieldId, throwing an exception
92 * if it is not found.
93 */
94 public static _Fields findByThriftIdOrThrow(int fieldId) {
95 _Fields fields = findByThriftId(fieldId);
96 if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
97 return fields;
98 }
99
100 /**
101 * Find the _Fields constant that matches name, or null if its not found.
102 */
103 public static _Fields findByName(String name) {
104 return byName.get(name);
105 }
106
107 private final short _thriftId;
108 private final String _fieldName;
109
110 _Fields(short thriftId, String fieldName) {
111 _thriftId = thriftId;
112 _fieldName = fieldName;
113 }
114
115 public short getThriftFieldId() {
116 return _thriftId;
117 }
118
119 public String getFieldName() {
120 return _fieldName;
121 }
122 }
123
124 // isset id assignments
125 private static final int __PROTOCOL_VERSION_ISSET_ID = 0;
126 private byte __isset_bitfield = 0;
127 public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
128 static {
129 Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
130 tmpMap.put(_Fields.PROTOCOL_VERSION, new org.apache.thrift.meta_data.FieldMetaData("protocol_version", org.apache.thrift.TFieldRequirementType.REQUIRED,
131 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
132 tmpMap.put(_Fields.REQUESTOR_USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("requestorUserName", org.apache.thrift.TFieldRequirementType.REQUIRED,
133 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
134 tmpMap.put(_Fields.ROLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("roleName", org.apache.thrift.TFieldRequirementType.REQUIRED,
135 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
136 tmpMap.put(_Fields.USERS, new org.apache.thrift.meta_data.FieldMetaData("users", org.apache.thrift.TFieldRequirementType.REQUIRED,
137 new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET,
138 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
139 metaDataMap = Collections.unmodifiableMap(tmpMap);
140 org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TAlterSentryRoleAddUsersRequest.class, metaDataMap);
141 }
142
143 public TAlterSentryRoleAddUsersRequest() {
144 this.protocol_version = 1;
145
146 }
147
148 public TAlterSentryRoleAddUsersRequest(
149 int protocol_version,
150 String requestorUserName,
151 String roleName,
152 Set<String> users)
153 {
154 this();
155 this.protocol_version = protocol_version;
156 setProtocol_versionIsSet(true);
157 this.requestorUserName = requestorUserName;
158 this.roleName = roleName;
159 this.users = users;
160 }
161
162 /**
163 * Performs a deep copy on <i>other</i>.
164 */
165 public TAlterSentryRoleAddUsersRequest(TAlterSentryRoleAddUsersRequest other) {
166 __isset_bitfield = other.__isset_bitfield;
167 this.protocol_version = other.protocol_version;
168 if (other.isSetRequestorUserName()) {
169 this.requestorUserName = other.requestorUserName;
170 }
171 if (other.isSetRoleName()) {
172 this.roleName = other.roleName;
173 }
174 if (other.isSetUsers()) {
175 Set<String> __this__users = new HashSet<String>(other.users);
176 this.users = __this__users;
177 }
178 }
179
180 public TAlterSentryRoleAddUsersRequest deepCopy() {
181 return new TAlterSentryRoleAddUsersRequest(this);
182 }
183
184 @Override
185 public void clear() {
186 this.protocol_version = 1;
187
188 this.requestorUserName = null;
189 this.roleName = null;
190 this.users = null;
191 }
192
193 public int getProtocol_version() {
194 return this.protocol_version;
195 }
196
197 public void setProtocol_version(int protocol_version) {
198 this.protocol_version = protocol_version;
199 setProtocol_versionIsSet(true);
200 }
201
202 public void unsetProtocol_version() {
203 __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PROTOCOL_VERSION_ISSET_ID);
204 }
205
206 /** Returns true if field protocol_version is set (has been assigned a value) and false otherwise */
207 public boolean isSetProtocol_version() {
208 return EncodingUtils.testBit(__isset_bitfield, __PROTOCOL_VERSION_ISSET_ID);
209 }
210
211 public void setProtocol_versionIsSet(boolean value) {
212 __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PROTOCOL_VERSION_ISSET_ID, value);
213 }
214
215 public String getRequestorUserName() {
216 return this.requestorUserName;
217 }
218
219 public void setRequestorUserName(String requestorUserName) {
220 this.requestorUserName = requestorUserName;
221 }
222
223 public void unsetRequestorUserName() {
224 this.requestorUserName = null;
225 }
226
227 /** Returns true if field requestorUserName is set (has been assigned a value) and false otherwise */
228 public boolean isSetRequestorUserName() {
229 return this.requestorUserName != null;
230 }
231
232 public void setRequestorUserNameIsSet(boolean value) {
233 if (!value) {
234 this.requestorUserName = null;
235 }
236 }
237
238 public String getRoleName() {
239 return this.roleName;
240 }
241
242 public void setRoleName(String roleName) {
243 this.roleName = roleName;
244 }
245
246 public void unsetRoleName() {
247 this.roleName = null;
248 }
249
250 /** Returns true if field roleName is set (has been assigned a value) and false otherwise */
251 public boolean isSetRoleName() {
252 return this.roleName != null;
253 }
254
255 public void setRoleNameIsSet(boolean value) {
256 if (!value) {
257 this.roleName = null;
258 }
259 }
260
261 public int getUsersSize() {
262 return (this.users == null) ? 0 : this.users.size();
263 }
264
265 public java.util.Iterator<String> getUsersIterator() {
266 return (this.users == null) ? null : this.users.iterator();
267 }
268
269 public void addToUsers(String elem) {
270 if (this.users == null) {
271 this.users = new HashSet<String>();
272 }
273 this.users.add(elem);
274 }
275
276 public Set<String> getUsers() {
277 return this.users;
278 }
279
280 public void setUsers(Set<String> users) {
281 this.users = users;
282 }
283
284 public void unsetUsers() {
285 this.users = null;
286 }
287
288 /** Returns true if field users is set (has been assigned a value) and false otherwise */
289 public boolean isSetUsers() {
290 return this.users != null;
291 }
292
293 public void setUsersIsSet(boolean value) {
294 if (!value) {
295 this.users = null;
296 }
297 }
298
299 public void setFieldValue(_Fields field, Object value) {
300 switch (field) {
301 case PROTOCOL_VERSION:
302 if (value == null) {
303 unsetProtocol_version();
304 } else {
305 setProtocol_version((Integer)value);
306 }
307 break;
308
309 case REQUESTOR_USER_NAME:
310 if (value == null) {
311 unsetRequestorUserName();
312 } else {
313 setRequestorUserName((String)value);
314 }
315 break;
316
317 case ROLE_NAME:
318 if (value == null) {
319 unsetRoleName();
320 } else {
321 setRoleName((String)value);
322 }
323 break;
324
325 case USERS:
326 if (value == null) {
327 unsetUsers();
328 } else {
329 setUsers((Set<String>)value);
330 }
331 break;
332
333 }
334 }
335
336 public Object getFieldValue(_Fields field) {
337 switch (field) {
338 case PROTOCOL_VERSION:
339 return getProtocol_version();
340
341 case REQUESTOR_USER_NAME:
342 return getRequestorUserName();
343
344 case ROLE_NAME:
345 return getRoleName();
346
347 case USERS:
348 return getUsers();
349
350 }
351 throw new IllegalStateException();
352 }
353
354 /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
355 public boolean isSet(_Fields field) {
356 if (field == null) {
357 throw new IllegalArgumentException();
358 }
359
360 switch (field) {
361 case PROTOCOL_VERSION:
362 return isSetProtocol_version();
363 case REQUESTOR_USER_NAME:
364 return isSetRequestorUserName();
365 case ROLE_NAME:
366 return isSetRoleName();
367 case USERS:
368 return isSetUsers();
369 }
370 throw new IllegalStateException();
371 }
372
373 @Override
374 public boolean equals(Object that) {
375 if (that == null)
376 return false;
377 if (that instanceof TAlterSentryRoleAddUsersRequest)
378 return this.equals((TAlterSentryRoleAddUsersRequest)that);
379 return false;
380 }
381
382 public boolean equals(TAlterSentryRoleAddUsersRequest that) {
383 if (that == null)
384 return false;
385
386 boolean this_present_protocol_version = true;
387 boolean that_present_protocol_version = true;
388 if (this_present_protocol_version || that_present_protocol_version) {
389 if (!(this_present_protocol_version && that_present_protocol_version))
390 return false;
391 if (this.protocol_version != that.protocol_version)
392 return false;
393 }
394
395 boolean this_present_requestorUserName = true && this.isSetRequestorUserName();
396 boolean that_present_requestorUserName = true && that.isSetRequestorUserName();
397 if (this_present_requestorUserName || that_present_requestorUserName) {
398 if (!(this_present_requestorUserName && that_present_requestorUserName))
399 return false;
400 if (!this.requestorUserName.equals(that.requestorUserName))
401 return false;
402 }
403
404 boolean this_present_roleName = true && this.isSetRoleName();
405 boolean that_present_roleName = true && that.isSetRoleName();
406 if (this_present_roleName || that_present_roleName) {
407 if (!(this_present_roleName && that_present_roleName))
408 return false;
409 if (!this.roleName.equals(that.roleName))
410 return false;
411 }
412
413 boolean this_present_users = true && this.isSetUsers();
414 boolean that_present_users = true && that.isSetUsers();
415 if (this_present_users || that_present_users) {
416 if (!(this_present_users && that_present_users))
417 return false;
418 if (!this.users.equals(that.users))
419 return false;
420 }
421
422 return true;
423 }
424
425 @Override
426 public int hashCode() {
427 List<Object> list = new ArrayList<Object>();
428
429 boolean present_protocol_version = true;
430 list.add(present_protocol_version);
431 if (present_protocol_version)
432 list.add(protocol_version);
433
434 boolean present_requestorUserName = true && (isSetRequestorUserName());
435 list.add(present_requestorUserName);
436 if (present_requestorUserName)
437 list.add(requestorUserName);
438
439 boolean present_roleName = true && (isSetRoleName());
440 list.add(present_roleName);
441 if (present_roleName)
442 list.add(roleName);
443
444 boolean present_users = true && (isSetUsers());
445 list.add(present_users);
446 if (present_users)
447 list.add(users);
448
449 return list.hashCode();
450 }
451
452 @Override
453 public int compareTo(TAlterSentryRoleAddUsersRequest other) {
454 if (!getClass().equals(other.getClass())) {
455 return getClass().getName().compareTo(other.getClass().getName());
456 }
457
458 int lastComparison = 0;
459
460 lastComparison = Boolean.valueOf(isSetProtocol_version()).compareTo(other.isSetProtocol_version());
461 if (lastComparison != 0) {
462 return lastComparison;
463 }
464 if (isSetProtocol_version()) {
465 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.protocol_version, other.protocol_version);
466 if (lastComparison != 0) {
467 return lastComparison;
468 }
469 }
470 lastComparison = Boolean.valueOf(isSetRequestorUserName()).compareTo(other.isSetRequestorUserName());
471 if (lastComparison != 0) {
472 return lastComparison;
473 }
474 if (isSetRequestorUserName()) {
475 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.requestorUserName, other.requestorUserName);
476 if (lastComparison != 0) {
477 return lastComparison;
478 }
479 }
480 lastComparison = Boolean.valueOf(isSetRoleName()).compareTo(other.isSetRoleName());
481 if (lastComparison != 0) {
482 return lastComparison;
483 }
484 if (isSetRoleName()) {
485 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.roleName, other.roleName);
486 if (lastComparison != 0) {
487 return lastComparison;
488 }
489 }
490 lastComparison = Boolean.valueOf(isSetUsers()).compareTo(other.isSetUsers());
491 if (lastComparison != 0) {
492 return lastComparison;
493 }
494 if (isSetUsers()) {
495 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.users, other.users);
496 if (lastComparison != 0) {
497 return lastComparison;
498 }
499 }
500 return 0;
501 }
502
503 public _Fields fieldForId(int fieldId) {
504 return _Fields.findByThriftId(fieldId);
505 }
506
507 public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
508 schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
509 }
510
511 public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
512 schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
513 }
514
515 @Override
516 public String toString() {
517 StringBuilder sb = new StringBuilder("TAlterSentryRoleAddUsersRequest(");
518 boolean first = true;
519
520 sb.append("protocol_version:");
521 sb.append(this.protocol_version);
522 first = false;
523 if (!first) sb.append(", ");
524 sb.append("requestorUserName:");
525 if (this.requestorUserName == null) {
526 sb.append("null");
527 } else {
528 sb.append(this.requestorUserName);
529 }
530 first = false;
531 if (!first) sb.append(", ");
532 sb.append("roleName:");
533 if (this.roleName == null) {
534 sb.append("null");
535 } else {
536 sb.append(this.roleName);
537 }
538 first = false;
539 if (!first) sb.append(", ");
540 sb.append("users:");
541 if (this.users == null) {
542 sb.append("null");
543 } else {
544 sb.append(this.users);
545 }
546 first = false;
547 sb.append(")");
548 return sb.toString();
549 }
550
551 public void validate() throws org.apache.thrift.TException {
552 // check for required fields
553 if (!isSetProtocol_version()) {
554 throw new org.apache.thrift.protocol.TProtocolException("Required field 'protocol_version' is unset! Struct:" + toString());
555 }
556
557 if (!isSetRequestorUserName()) {
558 throw new org.apache.thrift.protocol.TProtocolException("Required field 'requestorUserName' is unset! Struct:" + toString());
559 }
560
561 if (!isSetRoleName()) {
562 throw new org.apache.thrift.protocol.TProtocolException("Required field 'roleName' is unset! Struct:" + toString());
563 }
564
565 if (!isSetUsers()) {
566 throw new org.apache.thrift.protocol.TProtocolException("Required field 'users' is unset! Struct:" + toString());
567 }
568
569 // check for sub-struct validity
570 }
571
572 private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
573 try {
574 write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
575 } catch (org.apache.thrift.TException te) {
576 throw new java.io.IOException(te);
577 }
578 }
579
580 private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
581 try {
582 // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
583 __isset_bitfield = 0;
584 read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
585 } catch (org.apache.thrift.TException te) {
586 throw new java.io.IOException(te);
587 }
588 }
589
590 private static class TAlterSentryRoleAddUsersRequestStandardSchemeFactory implements SchemeFactory {
591 public TAlterSentryRoleAddUsersRequestStandardScheme getScheme() {
592 return new TAlterSentryRoleAddUsersRequestStandardScheme();
593 }
594 }
595
596 private static class TAlterSentryRoleAddUsersRequestStandardScheme extends StandardScheme<TAlterSentryRoleAddUsersRequest> {
597
598 public void read(org.apache.thrift.protocol.TProtocol iprot, TAlterSentryRoleAddUsersRequest struct) throws org.apache.thrift.TException {
599 org.apache.thrift.protocol.TField schemeField;
600 iprot.readStructBegin();
601 while (true)
602 {
603 schemeField = iprot.readFieldBegin();
604 if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
605 break;
606 }
607 switch (schemeField.id) {
608 case 1: // PROTOCOL_VERSION
609 if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
610 struct.protocol_version = iprot.readI32();
611 struct.setProtocol_versionIsSet(true);
612 } else {
613 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
614 }
615 break;
616 case 2: // REQUESTOR_USER_NAME
617 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
618 struct.requestorUserName = iprot.readString();
619 struct.setRequestorUserNameIsSet(true);
620 } else {
621 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
622 }
623 break;
624 case 3: // ROLE_NAME
625 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
626 struct.roleName = iprot.readString();
627 struct.setRoleNameIsSet(true);
628 } else {
629 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
630 }
631 break;
632 case 4: // USERS
633 if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
634 {
635 org.apache.thrift.protocol.TSet _set8 = iprot.readSetBegin();
636 struct.users = new HashSet<String>(2*_set8.size);
637 String _elem9;
638 for (int _i10 = 0; _i10 < _set8.size; ++_i10)
639 {
640 _elem9 = iprot.readString();
641 struct.users.add(_elem9);
642 }
643 iprot.readSetEnd();
644 }
645 struct.setUsersIsSet(true);
646 } else {
647 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
648 }
649 break;
650 default:
651 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
652 }
653 iprot.readFieldEnd();
654 }
655 iprot.readStructEnd();
656 struct.validate();
657 }
658
659 public void write(org.apache.thrift.protocol.TProtocol oprot, TAlterSentryRoleAddUsersRequest struct) throws org.apache.thrift.TException {
660 struct.validate();
661
662 oprot.writeStructBegin(STRUCT_DESC);
663 oprot.writeFieldBegin(PROTOCOL_VERSION_FIELD_DESC);
664 oprot.writeI32(struct.protocol_version);
665 oprot.writeFieldEnd();
666 if (struct.requestorUserName != null) {
667 oprot.writeFieldBegin(REQUESTOR_USER_NAME_FIELD_DESC);
668 oprot.writeString(struct.requestorUserName);
669 oprot.writeFieldEnd();
670 }
671 if (struct.roleName != null) {
672 oprot.writeFieldBegin(ROLE_NAME_FIELD_DESC);
673 oprot.writeString(struct.roleName);
674 oprot.writeFieldEnd();
675 }
676 if (struct.users != null) {
677 oprot.writeFieldBegin(USERS_FIELD_DESC);
678 {
679 oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.users.size()));
680 for (String _iter11 : struct.users)
681 {
682 oprot.writeString(_iter11);
683 }
684 oprot.writeSetEnd();
685 }
686 oprot.writeFieldEnd();
687 }
688 oprot.writeFieldStop();
689 oprot.writeStructEnd();
690 }
691
692 }
693
694 private static class TAlterSentryRoleAddUsersRequestTupleSchemeFactory implements SchemeFactory {
695 public TAlterSentryRoleAddUsersRequestTupleScheme getScheme() {
696 return new TAlterSentryRoleAddUsersRequestTupleScheme();
697 }
698 }
699
700 private static class TAlterSentryRoleAddUsersRequestTupleScheme extends TupleScheme<TAlterSentryRoleAddUsersRequest> {
701
702 @Override
703 public void write(org.apache.thrift.protocol.TProtocol prot, TAlterSentryRoleAddUsersRequest struct) throws org.apache.thrift.TException {
704 TTupleProtocol oprot = (TTupleProtocol) prot;
705 oprot.writeI32(struct.protocol_version);
706 oprot.writeString(struct.requestorUserName);
707 oprot.writeString(struct.roleName);
708 {
709 oprot.writeI32(struct.users.size());
710 for (String _iter12 : struct.users)
711 {
712 oprot.writeString(_iter12);
713 }
714 }
715 }
716
717 @Override
718 public void read(org.apache.thrift.protocol.TProtocol prot, TAlterSentryRoleAddUsersRequest struct) throws org.apache.thrift.TException {
719 TTupleProtocol iprot = (TTupleProtocol) prot;
720 struct.protocol_version = iprot.readI32();
721 struct.setProtocol_versionIsSet(true);
722 struct.requestorUserName = iprot.readString();
723 struct.setRequestorUserNameIsSet(true);
724 struct.roleName = iprot.readString();
725 struct.setRoleNameIsSet(true);
726 {
727 org.apache.thrift.protocol.TSet _set13 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
728 struct.users = new HashSet<String>(2*_set13.size);
729 String _elem14;
730 for (int _i15 = 0; _i15 < _set13.size; ++_i15)
731 {
732 _elem14 = iprot.readString();
733 struct.users.add(_elem14);
734 }
735 }
736 struct.setUsersIsSet(true);
737 }
738 }
739
740 }
741