PageRenderTime 42ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/release-0.0.0-rc0/hive/external/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/PrincipalPrivilegeSet.java

#
Java | 683 lines | 574 code | 84 blank | 25 comment | 125 complexity | d81040e9fb85b198fb76f6e93bc9f450 MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, JSON, CPL-1.0
  1. /**
  2. * Autogenerated by Thrift
  3. *
  4. * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  5. */
  6. package org.apache.hadoop.hive.metastore.api;
  7. import java.util.List;
  8. import java.util.ArrayList;
  9. import java.util.Map;
  10. import java.util.HashMap;
  11. import java.util.EnumMap;
  12. import java.util.Set;
  13. import java.util.HashSet;
  14. import java.util.EnumSet;
  15. import java.util.Collections;
  16. import java.util.BitSet;
  17. import java.nio.ByteBuffer;
  18. import java.util.Arrays;
  19. import org.slf4j.Logger;
  20. import org.slf4j.LoggerFactory;
  21. import org.apache.thrift.*;
  22. import org.apache.thrift.async.*;
  23. import org.apache.thrift.meta_data.*;
  24. import org.apache.thrift.transport.*;
  25. import org.apache.thrift.protocol.*;
  26. public class PrincipalPrivilegeSet implements TBase<PrincipalPrivilegeSet, PrincipalPrivilegeSet._Fields>, java.io.Serializable, Cloneable {
  27. private static final TStruct STRUCT_DESC = new TStruct("PrincipalPrivilegeSet");
  28. private static final TField USER_PRIVILEGES_FIELD_DESC = new TField("userPrivileges", TType.MAP, (short)1);
  29. private static final TField GROUP_PRIVILEGES_FIELD_DESC = new TField("groupPrivileges", TType.MAP, (short)2);
  30. private static final TField ROLE_PRIVILEGES_FIELD_DESC = new TField("rolePrivileges", TType.MAP, (short)3);
  31. private Map<String,List<PrivilegeGrantInfo>> userPrivileges;
  32. private Map<String,List<PrivilegeGrantInfo>> groupPrivileges;
  33. private Map<String,List<PrivilegeGrantInfo>> rolePrivileges;
  34. /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  35. public enum _Fields implements TFieldIdEnum {
  36. USER_PRIVILEGES((short)1, "userPrivileges"),
  37. GROUP_PRIVILEGES((short)2, "groupPrivileges"),
  38. ROLE_PRIVILEGES((short)3, "rolePrivileges");
  39. private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
  40. static {
  41. for (_Fields field : EnumSet.allOf(_Fields.class)) {
  42. byName.put(field.getFieldName(), field);
  43. }
  44. }
  45. /**
  46. * Find the _Fields constant that matches fieldId, or null if its not found.
  47. */
  48. public static _Fields findByThriftId(int fieldId) {
  49. switch(fieldId) {
  50. case 1: // USER_PRIVILEGES
  51. return USER_PRIVILEGES;
  52. case 2: // GROUP_PRIVILEGES
  53. return GROUP_PRIVILEGES;
  54. case 3: // ROLE_PRIVILEGES
  55. return ROLE_PRIVILEGES;
  56. default:
  57. return null;
  58. }
  59. }
  60. /**
  61. * Find the _Fields constant that matches fieldId, throwing an exception
  62. * if it is not found.
  63. */
  64. public static _Fields findByThriftIdOrThrow(int fieldId) {
  65. _Fields fields = findByThriftId(fieldId);
  66. if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
  67. return fields;
  68. }
  69. /**
  70. * Find the _Fields constant that matches name, or null if its not found.
  71. */
  72. public static _Fields findByName(String name) {
  73. return byName.get(name);
  74. }
  75. private final short _thriftId;
  76. private final String _fieldName;
  77. _Fields(short thriftId, String fieldName) {
  78. _thriftId = thriftId;
  79. _fieldName = fieldName;
  80. }
  81. public short getThriftFieldId() {
  82. return _thriftId;
  83. }
  84. public String getFieldName() {
  85. return _fieldName;
  86. }
  87. }
  88. // isset id assignments
  89. public static final Map<_Fields, FieldMetaData> metaDataMap;
  90. static {
  91. Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class);
  92. tmpMap.put(_Fields.USER_PRIVILEGES, new FieldMetaData("userPrivileges", TFieldRequirementType.DEFAULT,
  93. new MapMetaData(TType.MAP,
  94. new FieldValueMetaData(TType.STRING),
  95. new ListMetaData(TType.LIST,
  96. new StructMetaData(TType.STRUCT, PrivilegeGrantInfo.class)))));
  97. tmpMap.put(_Fields.GROUP_PRIVILEGES, new FieldMetaData("groupPrivileges", TFieldRequirementType.DEFAULT,
  98. new MapMetaData(TType.MAP,
  99. new FieldValueMetaData(TType.STRING),
  100. new ListMetaData(TType.LIST,
  101. new StructMetaData(TType.STRUCT, PrivilegeGrantInfo.class)))));
  102. tmpMap.put(_Fields.ROLE_PRIVILEGES, new FieldMetaData("rolePrivileges", TFieldRequirementType.DEFAULT,
  103. new MapMetaData(TType.MAP,
  104. new FieldValueMetaData(TType.STRING),
  105. new ListMetaData(TType.LIST,
  106. new StructMetaData(TType.STRUCT, PrivilegeGrantInfo.class)))));
  107. metaDataMap = Collections.unmodifiableMap(tmpMap);
  108. FieldMetaData.addStructMetaDataMap(PrincipalPrivilegeSet.class, metaDataMap);
  109. }
  110. public PrincipalPrivilegeSet() {
  111. }
  112. public PrincipalPrivilegeSet(
  113. Map<String,List<PrivilegeGrantInfo>> userPrivileges,
  114. Map<String,List<PrivilegeGrantInfo>> groupPrivileges,
  115. Map<String,List<PrivilegeGrantInfo>> rolePrivileges)
  116. {
  117. this();
  118. this.userPrivileges = userPrivileges;
  119. this.groupPrivileges = groupPrivileges;
  120. this.rolePrivileges = rolePrivileges;
  121. }
  122. /**
  123. * Performs a deep copy on <i>other</i>.
  124. */
  125. public PrincipalPrivilegeSet(PrincipalPrivilegeSet other) {
  126. if (other.isSetUserPrivileges()) {
  127. Map<String,List<PrivilegeGrantInfo>> __this__userPrivileges = new HashMap<String,List<PrivilegeGrantInfo>>();
  128. for (Map.Entry<String, List<PrivilegeGrantInfo>> other_element : other.userPrivileges.entrySet()) {
  129. String other_element_key = other_element.getKey();
  130. List<PrivilegeGrantInfo> other_element_value = other_element.getValue();
  131. String __this__userPrivileges_copy_key = other_element_key;
  132. List<PrivilegeGrantInfo> __this__userPrivileges_copy_value = new ArrayList<PrivilegeGrantInfo>();
  133. for (PrivilegeGrantInfo other_element_value_element : other_element_value) {
  134. __this__userPrivileges_copy_value.add(new PrivilegeGrantInfo(other_element_value_element));
  135. }
  136. __this__userPrivileges.put(__this__userPrivileges_copy_key, __this__userPrivileges_copy_value);
  137. }
  138. this.userPrivileges = __this__userPrivileges;
  139. }
  140. if (other.isSetGroupPrivileges()) {
  141. Map<String,List<PrivilegeGrantInfo>> __this__groupPrivileges = new HashMap<String,List<PrivilegeGrantInfo>>();
  142. for (Map.Entry<String, List<PrivilegeGrantInfo>> other_element : other.groupPrivileges.entrySet()) {
  143. String other_element_key = other_element.getKey();
  144. List<PrivilegeGrantInfo> other_element_value = other_element.getValue();
  145. String __this__groupPrivileges_copy_key = other_element_key;
  146. List<PrivilegeGrantInfo> __this__groupPrivileges_copy_value = new ArrayList<PrivilegeGrantInfo>();
  147. for (PrivilegeGrantInfo other_element_value_element : other_element_value) {
  148. __this__groupPrivileges_copy_value.add(new PrivilegeGrantInfo(other_element_value_element));
  149. }
  150. __this__groupPrivileges.put(__this__groupPrivileges_copy_key, __this__groupPrivileges_copy_value);
  151. }
  152. this.groupPrivileges = __this__groupPrivileges;
  153. }
  154. if (other.isSetRolePrivileges()) {
  155. Map<String,List<PrivilegeGrantInfo>> __this__rolePrivileges = new HashMap<String,List<PrivilegeGrantInfo>>();
  156. for (Map.Entry<String, List<PrivilegeGrantInfo>> other_element : other.rolePrivileges.entrySet()) {
  157. String other_element_key = other_element.getKey();
  158. List<PrivilegeGrantInfo> other_element_value = other_element.getValue();
  159. String __this__rolePrivileges_copy_key = other_element_key;
  160. List<PrivilegeGrantInfo> __this__rolePrivileges_copy_value = new ArrayList<PrivilegeGrantInfo>();
  161. for (PrivilegeGrantInfo other_element_value_element : other_element_value) {
  162. __this__rolePrivileges_copy_value.add(new PrivilegeGrantInfo(other_element_value_element));
  163. }
  164. __this__rolePrivileges.put(__this__rolePrivileges_copy_key, __this__rolePrivileges_copy_value);
  165. }
  166. this.rolePrivileges = __this__rolePrivileges;
  167. }
  168. }
  169. public PrincipalPrivilegeSet deepCopy() {
  170. return new PrincipalPrivilegeSet(this);
  171. }
  172. @Override
  173. public void clear() {
  174. this.userPrivileges = null;
  175. this.groupPrivileges = null;
  176. this.rolePrivileges = null;
  177. }
  178. public int getUserPrivilegesSize() {
  179. return (this.userPrivileges == null) ? 0 : this.userPrivileges.size();
  180. }
  181. public void putToUserPrivileges(String key, List<PrivilegeGrantInfo> val) {
  182. if (this.userPrivileges == null) {
  183. this.userPrivileges = new HashMap<String,List<PrivilegeGrantInfo>>();
  184. }
  185. this.userPrivileges.put(key, val);
  186. }
  187. public Map<String,List<PrivilegeGrantInfo>> getUserPrivileges() {
  188. return this.userPrivileges;
  189. }
  190. public void setUserPrivileges(Map<String,List<PrivilegeGrantInfo>> userPrivileges) {
  191. this.userPrivileges = userPrivileges;
  192. }
  193. public void unsetUserPrivileges() {
  194. this.userPrivileges = null;
  195. }
  196. /** Returns true if field userPrivileges is set (has been asigned a value) and false otherwise */
  197. public boolean isSetUserPrivileges() {
  198. return this.userPrivileges != null;
  199. }
  200. public void setUserPrivilegesIsSet(boolean value) {
  201. if (!value) {
  202. this.userPrivileges = null;
  203. }
  204. }
  205. public int getGroupPrivilegesSize() {
  206. return (this.groupPrivileges == null) ? 0 : this.groupPrivileges.size();
  207. }
  208. public void putToGroupPrivileges(String key, List<PrivilegeGrantInfo> val) {
  209. if (this.groupPrivileges == null) {
  210. this.groupPrivileges = new HashMap<String,List<PrivilegeGrantInfo>>();
  211. }
  212. this.groupPrivileges.put(key, val);
  213. }
  214. public Map<String,List<PrivilegeGrantInfo>> getGroupPrivileges() {
  215. return this.groupPrivileges;
  216. }
  217. public void setGroupPrivileges(Map<String,List<PrivilegeGrantInfo>> groupPrivileges) {
  218. this.groupPrivileges = groupPrivileges;
  219. }
  220. public void unsetGroupPrivileges() {
  221. this.groupPrivileges = null;
  222. }
  223. /** Returns true if field groupPrivileges is set (has been asigned a value) and false otherwise */
  224. public boolean isSetGroupPrivileges() {
  225. return this.groupPrivileges != null;
  226. }
  227. public void setGroupPrivilegesIsSet(boolean value) {
  228. if (!value) {
  229. this.groupPrivileges = null;
  230. }
  231. }
  232. public int getRolePrivilegesSize() {
  233. return (this.rolePrivileges == null) ? 0 : this.rolePrivileges.size();
  234. }
  235. public void putToRolePrivileges(String key, List<PrivilegeGrantInfo> val) {
  236. if (this.rolePrivileges == null) {
  237. this.rolePrivileges = new HashMap<String,List<PrivilegeGrantInfo>>();
  238. }
  239. this.rolePrivileges.put(key, val);
  240. }
  241. public Map<String,List<PrivilegeGrantInfo>> getRolePrivileges() {
  242. return this.rolePrivileges;
  243. }
  244. public void setRolePrivileges(Map<String,List<PrivilegeGrantInfo>> rolePrivileges) {
  245. this.rolePrivileges = rolePrivileges;
  246. }
  247. public void unsetRolePrivileges() {
  248. this.rolePrivileges = null;
  249. }
  250. /** Returns true if field rolePrivileges is set (has been asigned a value) and false otherwise */
  251. public boolean isSetRolePrivileges() {
  252. return this.rolePrivileges != null;
  253. }
  254. public void setRolePrivilegesIsSet(boolean value) {
  255. if (!value) {
  256. this.rolePrivileges = null;
  257. }
  258. }
  259. public void setFieldValue(_Fields field, Object value) {
  260. switch (field) {
  261. case USER_PRIVILEGES:
  262. if (value == null) {
  263. unsetUserPrivileges();
  264. } else {
  265. setUserPrivileges((Map<String,List<PrivilegeGrantInfo>>)value);
  266. }
  267. break;
  268. case GROUP_PRIVILEGES:
  269. if (value == null) {
  270. unsetGroupPrivileges();
  271. } else {
  272. setGroupPrivileges((Map<String,List<PrivilegeGrantInfo>>)value);
  273. }
  274. break;
  275. case ROLE_PRIVILEGES:
  276. if (value == null) {
  277. unsetRolePrivileges();
  278. } else {
  279. setRolePrivileges((Map<String,List<PrivilegeGrantInfo>>)value);
  280. }
  281. break;
  282. }
  283. }
  284. public Object getFieldValue(_Fields field) {
  285. switch (field) {
  286. case USER_PRIVILEGES:
  287. return getUserPrivileges();
  288. case GROUP_PRIVILEGES:
  289. return getGroupPrivileges();
  290. case ROLE_PRIVILEGES:
  291. return getRolePrivileges();
  292. }
  293. throw new IllegalStateException();
  294. }
  295. /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
  296. public boolean isSet(_Fields field) {
  297. if (field == null) {
  298. throw new IllegalArgumentException();
  299. }
  300. switch (field) {
  301. case USER_PRIVILEGES:
  302. return isSetUserPrivileges();
  303. case GROUP_PRIVILEGES:
  304. return isSetGroupPrivileges();
  305. case ROLE_PRIVILEGES:
  306. return isSetRolePrivileges();
  307. }
  308. throw new IllegalStateException();
  309. }
  310. @Override
  311. public boolean equals(Object that) {
  312. if (that == null)
  313. return false;
  314. if (that instanceof PrincipalPrivilegeSet)
  315. return this.equals((PrincipalPrivilegeSet)that);
  316. return false;
  317. }
  318. public boolean equals(PrincipalPrivilegeSet that) {
  319. if (that == null)
  320. return false;
  321. boolean this_present_userPrivileges = true && this.isSetUserPrivileges();
  322. boolean that_present_userPrivileges = true && that.isSetUserPrivileges();
  323. if (this_present_userPrivileges || that_present_userPrivileges) {
  324. if (!(this_present_userPrivileges && that_present_userPrivileges))
  325. return false;
  326. if (!this.userPrivileges.equals(that.userPrivileges))
  327. return false;
  328. }
  329. boolean this_present_groupPrivileges = true && this.isSetGroupPrivileges();
  330. boolean that_present_groupPrivileges = true && that.isSetGroupPrivileges();
  331. if (this_present_groupPrivileges || that_present_groupPrivileges) {
  332. if (!(this_present_groupPrivileges && that_present_groupPrivileges))
  333. return false;
  334. if (!this.groupPrivileges.equals(that.groupPrivileges))
  335. return false;
  336. }
  337. boolean this_present_rolePrivileges = true && this.isSetRolePrivileges();
  338. boolean that_present_rolePrivileges = true && that.isSetRolePrivileges();
  339. if (this_present_rolePrivileges || that_present_rolePrivileges) {
  340. if (!(this_present_rolePrivileges && that_present_rolePrivileges))
  341. return false;
  342. if (!this.rolePrivileges.equals(that.rolePrivileges))
  343. return false;
  344. }
  345. return true;
  346. }
  347. @Override
  348. public int hashCode() {
  349. return 0;
  350. }
  351. public int compareTo(PrincipalPrivilegeSet other) {
  352. if (!getClass().equals(other.getClass())) {
  353. return getClass().getName().compareTo(other.getClass().getName());
  354. }
  355. int lastComparison = 0;
  356. PrincipalPrivilegeSet typedOther = (PrincipalPrivilegeSet)other;
  357. lastComparison = Boolean.valueOf(isSetUserPrivileges()).compareTo(typedOther.isSetUserPrivileges());
  358. if (lastComparison != 0) {
  359. return lastComparison;
  360. }
  361. if (isSetUserPrivileges()) {
  362. lastComparison = TBaseHelper.compareTo(this.userPrivileges, typedOther.userPrivileges);
  363. if (lastComparison != 0) {
  364. return lastComparison;
  365. }
  366. }
  367. lastComparison = Boolean.valueOf(isSetGroupPrivileges()).compareTo(typedOther.isSetGroupPrivileges());
  368. if (lastComparison != 0) {
  369. return lastComparison;
  370. }
  371. if (isSetGroupPrivileges()) {
  372. lastComparison = TBaseHelper.compareTo(this.groupPrivileges, typedOther.groupPrivileges);
  373. if (lastComparison != 0) {
  374. return lastComparison;
  375. }
  376. }
  377. lastComparison = Boolean.valueOf(isSetRolePrivileges()).compareTo(typedOther.isSetRolePrivileges());
  378. if (lastComparison != 0) {
  379. return lastComparison;
  380. }
  381. if (isSetRolePrivileges()) {
  382. lastComparison = TBaseHelper.compareTo(this.rolePrivileges, typedOther.rolePrivileges);
  383. if (lastComparison != 0) {
  384. return lastComparison;
  385. }
  386. }
  387. return 0;
  388. }
  389. public _Fields fieldForId(int fieldId) {
  390. return _Fields.findByThriftId(fieldId);
  391. }
  392. public void read(TProtocol iprot) throws TException {
  393. TField field;
  394. iprot.readStructBegin();
  395. while (true)
  396. {
  397. field = iprot.readFieldBegin();
  398. if (field.type == TType.STOP) {
  399. break;
  400. }
  401. switch (field.id) {
  402. case 1: // USER_PRIVILEGES
  403. if (field.type == TType.MAP) {
  404. {
  405. TMap _map12 = iprot.readMapBegin();
  406. this.userPrivileges = new HashMap<String,List<PrivilegeGrantInfo>>(2*_map12.size);
  407. for (int _i13 = 0; _i13 < _map12.size; ++_i13)
  408. {
  409. String _key14;
  410. List<PrivilegeGrantInfo> _val15;
  411. _key14 = iprot.readString();
  412. {
  413. TList _list16 = iprot.readListBegin();
  414. _val15 = new ArrayList<PrivilegeGrantInfo>(_list16.size);
  415. for (int _i17 = 0; _i17 < _list16.size; ++_i17)
  416. {
  417. PrivilegeGrantInfo _elem18;
  418. _elem18 = new PrivilegeGrantInfo();
  419. _elem18.read(iprot);
  420. _val15.add(_elem18);
  421. }
  422. iprot.readListEnd();
  423. }
  424. this.userPrivileges.put(_key14, _val15);
  425. }
  426. iprot.readMapEnd();
  427. }
  428. } else {
  429. TProtocolUtil.skip(iprot, field.type);
  430. }
  431. break;
  432. case 2: // GROUP_PRIVILEGES
  433. if (field.type == TType.MAP) {
  434. {
  435. TMap _map19 = iprot.readMapBegin();
  436. this.groupPrivileges = new HashMap<String,List<PrivilegeGrantInfo>>(2*_map19.size);
  437. for (int _i20 = 0; _i20 < _map19.size; ++_i20)
  438. {
  439. String _key21;
  440. List<PrivilegeGrantInfo> _val22;
  441. _key21 = iprot.readString();
  442. {
  443. TList _list23 = iprot.readListBegin();
  444. _val22 = new ArrayList<PrivilegeGrantInfo>(_list23.size);
  445. for (int _i24 = 0; _i24 < _list23.size; ++_i24)
  446. {
  447. PrivilegeGrantInfo _elem25;
  448. _elem25 = new PrivilegeGrantInfo();
  449. _elem25.read(iprot);
  450. _val22.add(_elem25);
  451. }
  452. iprot.readListEnd();
  453. }
  454. this.groupPrivileges.put(_key21, _val22);
  455. }
  456. iprot.readMapEnd();
  457. }
  458. } else {
  459. TProtocolUtil.skip(iprot, field.type);
  460. }
  461. break;
  462. case 3: // ROLE_PRIVILEGES
  463. if (field.type == TType.MAP) {
  464. {
  465. TMap _map26 = iprot.readMapBegin();
  466. this.rolePrivileges = new HashMap<String,List<PrivilegeGrantInfo>>(2*_map26.size);
  467. for (int _i27 = 0; _i27 < _map26.size; ++_i27)
  468. {
  469. String _key28;
  470. List<PrivilegeGrantInfo> _val29;
  471. _key28 = iprot.readString();
  472. {
  473. TList _list30 = iprot.readListBegin();
  474. _val29 = new ArrayList<PrivilegeGrantInfo>(_list30.size);
  475. for (int _i31 = 0; _i31 < _list30.size; ++_i31)
  476. {
  477. PrivilegeGrantInfo _elem32;
  478. _elem32 = new PrivilegeGrantInfo();
  479. _elem32.read(iprot);
  480. _val29.add(_elem32);
  481. }
  482. iprot.readListEnd();
  483. }
  484. this.rolePrivileges.put(_key28, _val29);
  485. }
  486. iprot.readMapEnd();
  487. }
  488. } else {
  489. TProtocolUtil.skip(iprot, field.type);
  490. }
  491. break;
  492. default:
  493. TProtocolUtil.skip(iprot, field.type);
  494. }
  495. iprot.readFieldEnd();
  496. }
  497. iprot.readStructEnd();
  498. validate();
  499. }
  500. public void write(TProtocol oprot) throws TException {
  501. validate();
  502. oprot.writeStructBegin(STRUCT_DESC);
  503. if (this.userPrivileges != null) {
  504. oprot.writeFieldBegin(USER_PRIVILEGES_FIELD_DESC);
  505. {
  506. oprot.writeMapBegin(new TMap(TType.STRING, TType.LIST, this.userPrivileges.size()));
  507. for (Map.Entry<String, List<PrivilegeGrantInfo>> _iter33 : this.userPrivileges.entrySet())
  508. {
  509. oprot.writeString(_iter33.getKey());
  510. {
  511. oprot.writeListBegin(new TList(TType.STRUCT, _iter33.getValue().size()));
  512. for (PrivilegeGrantInfo _iter34 : _iter33.getValue())
  513. {
  514. _iter34.write(oprot);
  515. }
  516. oprot.writeListEnd();
  517. }
  518. }
  519. oprot.writeMapEnd();
  520. }
  521. oprot.writeFieldEnd();
  522. }
  523. if (this.groupPrivileges != null) {
  524. oprot.writeFieldBegin(GROUP_PRIVILEGES_FIELD_DESC);
  525. {
  526. oprot.writeMapBegin(new TMap(TType.STRING, TType.LIST, this.groupPrivileges.size()));
  527. for (Map.Entry<String, List<PrivilegeGrantInfo>> _iter35 : this.groupPrivileges.entrySet())
  528. {
  529. oprot.writeString(_iter35.getKey());
  530. {
  531. oprot.writeListBegin(new TList(TType.STRUCT, _iter35.getValue().size()));
  532. for (PrivilegeGrantInfo _iter36 : _iter35.getValue())
  533. {
  534. _iter36.write(oprot);
  535. }
  536. oprot.writeListEnd();
  537. }
  538. }
  539. oprot.writeMapEnd();
  540. }
  541. oprot.writeFieldEnd();
  542. }
  543. if (this.rolePrivileges != null) {
  544. oprot.writeFieldBegin(ROLE_PRIVILEGES_FIELD_DESC);
  545. {
  546. oprot.writeMapBegin(new TMap(TType.STRING, TType.LIST, this.rolePrivileges.size()));
  547. for (Map.Entry<String, List<PrivilegeGrantInfo>> _iter37 : this.rolePrivileges.entrySet())
  548. {
  549. oprot.writeString(_iter37.getKey());
  550. {
  551. oprot.writeListBegin(new TList(TType.STRUCT, _iter37.getValue().size()));
  552. for (PrivilegeGrantInfo _iter38 : _iter37.getValue())
  553. {
  554. _iter38.write(oprot);
  555. }
  556. oprot.writeListEnd();
  557. }
  558. }
  559. oprot.writeMapEnd();
  560. }
  561. oprot.writeFieldEnd();
  562. }
  563. oprot.writeFieldStop();
  564. oprot.writeStructEnd();
  565. }
  566. @Override
  567. public String toString() {
  568. StringBuilder sb = new StringBuilder("PrincipalPrivilegeSet(");
  569. boolean first = true;
  570. sb.append("userPrivileges:");
  571. if (this.userPrivileges == null) {
  572. sb.append("null");
  573. } else {
  574. sb.append(this.userPrivileges);
  575. }
  576. first = false;
  577. if (!first) sb.append(", ");
  578. sb.append("groupPrivileges:");
  579. if (this.groupPrivileges == null) {
  580. sb.append("null");
  581. } else {
  582. sb.append(this.groupPrivileges);
  583. }
  584. first = false;
  585. if (!first) sb.append(", ");
  586. sb.append("rolePrivileges:");
  587. if (this.rolePrivileges == null) {
  588. sb.append("null");
  589. } else {
  590. sb.append(this.rolePrivileges);
  591. }
  592. first = false;
  593. sb.append(")");
  594. return sb.toString();
  595. }
  596. public void validate() throws TException {
  597. // check for required fields
  598. }
  599. }