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